1. 程式人生 > >pip install時報錯TypeError: __call__() missing 1 required positional argument: 'name'解決

pip install時報錯TypeError: __call__() missing 1 required positional argument: 'name'解決

最近在Ubuntu14.04使用pip3安裝軟體包的時候出現瞭如下錯誤:TypeError: call() missing 1 required positional argument: ‘name’, 具體報錯資訊如下:

 ziven@ziven-ubuntu-laptop  ~  pip3 install --user cheat
Collecting cheat
  Downloading cheat-2.2.0.tar.gz (63kB)
    100% |████████████████████████████████| 71kB 385kB/s 
Exception:
Traceback
(most recent call last): File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 335, in run wb.build(autobuilding=True) File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py"
, line 749, in build self.requirement_set.prepare_files(self.finder) File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 634, in _prepare_file abstract_dist.prep_for_dist() File
"/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist self.req_to_install.run_egg_info() File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 412, in run_egg_info self.setup_py, self.name, File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 387, in setup_py import setuptools # noqa File "/home/ziven/.local/lib/python3.4/site-packages/setuptools/__init__.py", line 12, in <module> import setuptools.version File "/home/ziven/.local/lib/python3.4/site-packages/setuptools/version.py", line 1, in <module> import pkg_resources File "/home/ziven/.local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 72, in <module> import packaging.requirements File "/home/ziven/.local/lib/python3.4/site-packages/packaging/requirements.py", line 59, in <module> MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker") TypeError: __call__() missing 1 required positional argument: 'name'

網上搜索了一下類似的問題,發現主要原因是:pyparsing的版本過低(具體原因可以參考這裡以及這裡)。
所以解決方法就是升級本地的pyparsing的版本到>=2.0.2.
所以在我本地我做了如下升級:

pip3 install --user --upgrade pyparsing

之後再執行之前的安裝就正常了:

[email protected]  ~  pip3 install --user cheat                    
Collecting cheat
  Using cached cheat-2.2.0.tar.gz
Collecting docopt>=0.6.1 (from cheat)
  Downloading docopt-0.6.2.tar.gz
Requirement already satisfied: pygments>=1.6.0 in /usr/lib/python3/dist-packages (from cheat)
Building wheels for collected packages: cheat, docopt
  Running setup.py bdist_wheel for cheat ... done
  Stored in directory: /home/ziven/.cache/pip/wheels/bb/41/50/bff985ad8a9305bef57ff23efb93aedf92377c8f076c9ab151
  Running setup.py bdist_wheel for docopt ... done
  Stored in directory: /home/ziven/.cache/pip/wheels/b2/16/5f/c33a2bb5f2dce71205f8e65cbfd05647d79d441282be31fd82
Successfully built cheat docopt
Installing collected packages: docopt, cheat
Successfully installed cheat-2.2.0 docopt-0.6.2

相關推薦

pip install時報TypeError: __call__() missing 1 required positional argument: 'name'解決

最近在Ubuntu14.04使用pip3安裝軟體包的時候出現瞭如下錯誤:TypeError: call() missing 1 required positional argument: ‘name’, 具體報錯資訊如下: ziven@ziven-ubunt

Django :執行 python manage.py makemigrations 時報 TypeError: __init__() missing 1 required positional argument: 'on_delete'

req del 命令 () ini color err position python 原因 執行命令 python manage.py makemigrations 報錯 TypeError: __init__() missing 1 required positi

【Python】django報TypeError: __init__() missing 1 required positional argument: 'on_delete'解決辦法

錯誤程式碼: from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible

django報TypeError: __init__() missing 1 required positional argument: 'on_delete'

在學習Django中,執行 python manage.py makemigrations learning_logs 時報的錯 TypeError: __init__() missing 1 required positional argument: 'on_delete' 解決 在

執行python manage.py makemigrations時報:__init__() missing 1 required positional argument: 'on_delete'

在執行python manage.py makemigrations時報錯:TypeError: __init__() missing 1 required positional argument: 'on_delete'解決方法:            在連線外來鍵時加上:

TypeError: save() missing 1 required positional argument: 'self'

解決辦法 生成 roman spa times 進行 ron mode error RT,在創建模型對象的時候,提示TypeError: save() missing 1 required positional argument: ‘self‘ 解決辦法:在創建模型對象的時

TypeError: __init__() missing 1 required positional argument: 'on_delete'

在自學Django框架時,在models.py中建立兩個資料庫表。在第二個表中引用第一個表的id作為外來鍵時,使用瞭如下語句。 輸入“python manage.py makemigrations"語句後報錯,TypeError: __init__() missing

Python小白進階——TypeError: replaceSpace() missing 1 required positional argument: 'self'

# -*- coding:utf-8 -*- class Solution: # s 源字串 def replaceSpace(self, s): # write code here s = list(s) k =

TypeError: __init__() missing 1 required positional argument: 'on_delete

試用Djiango的時候發現執行mange.py makemigrations 和 migrate是會報錯,少位置引數on_delete,查了一下是因為指定外來鍵的方式不對,改一下就OK了。author = models.ForeignKey(User, related_na

TypeError: run() missing 1 required positional argument: 'fetches'

如果嘗試 from tensorflow import Session as sess 則可能報這樣的錯。因為sess實際上為tf.Session(),請注意括號。 但是如果是from tensorflow import Session() as sess,則沒有這樣的語

Python中self的用法詳解,或者總是提示:TypeError: add() missing 1 required positional argument: 'self'的問題解決

最近在學習Python的過程中一直髮現一個問題,就是在從網上看別人寫的一些例項或者一些開源專案的時候,發現一個問題。在呼叫一個類或者一個類方法的時候,總是提示缺少傳遞的引數。自己寫了一個簡單的類似問題,如下: class Add(): def add(self)

Django在根據models生成數據庫表時報 __init__() missing 1 required positional argument: 'on_delete'

關系 .com lba delet file 可選 錯誤 完整性 http code: 1 #encoding=utf-8 2 from django.db import models 3 # Create your models here. 4 cla

處理: __init__() missing 1 required positional argument: 'on_delete'

在django2.0後,定義外來鍵和一對一關係的時候需要加on_delete選項,此引數為了避免兩個表裡的資料不一致問題,不然會報錯: TypeError: __init__() missing 1 required positional argument: 'on_delete' 舉例說明: us

Django在根據models生成資料庫表時報 __init__() missing 1 required positional argument: 'on_delete'

在runserver時報錯如題資訊 TypeError: __init__() missing 1 required positional argument: 'on_delete'   在models中沒有對外來鍵進行關聯, 原因: 在django2.0後,

Django2.1.4在根據models生成資料庫表時報 __init__() missing 1 required positional argument: 'on_delete'

解決辦法: 將程式碼改為: herobook=models.ForeignKey('BookInfo',on_delete=models.CASCADE,) 即在外來鍵值的後面加上 on_delete=models.CASCADE 原因: 在django2.0後,定義外來鍵和一對一關

pytroch forward() missing 1 required positional argument: 'input'的一個可能原因

vgg16=torchvision.models.vgg16(pretrained=True) class NET(nn.Module):     def __init__(self):       

Django:__init__() missing 1 required positional argument: 'on_delete'

__init__() missing 1 required positional argument: 'on_delete'   class Guest(models.Model): event = models.ForeignKey(Event) #關聯

問題Missing 1 required positional argument引出的關於python例項化的經驗教訓

class Solution: def mySqrt(self, x): """ :type x: int :rtype: int """ l = 0 r = x

解決:執行python manage.py makemigrations時提示錯誤:__init__() missing 1 required positional argument: 'on

 報錯資訊如下: (blog) λ python manage.py makemigrations Traceback (most recent call last): File "manage.py", line 15, in <module> e