Error when trying to install paramiko and cryptography in Kivy Buildozer - python

I am using a Kivy as a Virtual Machine (in MAC OS). I am trying to install the python packages pycrypto and paramiko. Starting with pycrypto, I tried
pip install pycrypto
Requirement already satisfied: pycrypto in /usr/local/lib/python2.7/dist-packages
but when I try to import it in python
>>> import pycrypto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pycrypto
In paramico, I get the following:
kivy#kivy-VirtualBox:~$ pip install paramiko
Collecting paramiko
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached paramiko-2.1.2-py2.py3-none-any.whl
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/dist-packages (from paramiko)
Collecting cryptography>=1.1 (from paramiko)
Using cached cryptography-1.7.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ZboIFP/cryptography/setup.py", line 334, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__
_Distribution.__init__(self, attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 386, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (six 1.5.2 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.6.0'))
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ZboIFP/cryptography/
Any suggestions?

From the command line try:
python 2.7 import pycrypto

Related

unable to install scikit-learn from git using jupyter notebook in my windows

i'm trying to import sklearn.metrics.multilabel_confusion_matrix, but since it is not in the normal package what I'm trying to do is install it using !pip install git+http://github.com/scikit-learn/scikit-learn.git in my windows using jupyter notebook. I used command prompt as well but the same problem occurred. but when I'm doing this an error is popping up which is shown bellow
it's saying something related to "Failed building wheel for scikit-learn
Could not install packages due to an EnvironmentError:"
have shown the complete dialogue below.
Please Help!!!
!pip install git+http://github.com/scikit-learn/scikit-learn.git
Collecting git+http://github.com/scikit-learn/scikit-learn.git
Cloning http://github.com/scikit-learn/scikit-learn.git to c:\users\intel\appdata\local\temp\pip-req-build-bg_zxcrm
Requirement already satisfied: numpy>=1.11.0 in c:\programdata\anaconda3\lib\site-packages (from scikit-learn==0.22.dev0) (1.15.4)
Requirement already satisfied: scipy>=0.17.0 in c:\programdata\anaconda3\lib\site-packages (from scikit-learn==0.22.dev0) (1.1.0)
Requirement already satisfied: joblib>=0.11 in c:\programdata\anaconda3\lib\site-packages (from scikit-learn==0.22.dev0) (0.14.0)
Building wheels for collected packages: scikit-learn
Running setup.py bdist_wheel for scikit-learn: started
Running setup.py bdist_wheel for scikit-learn: finished with status 'error'
Complete output from command C:\PROGRAMDATA\ANACONDA3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\INTEL\\AppData\\Local\\Temp\\pip-req-build-bg_zxcrm\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\INTEL\AppData\Local\Temp\pip-wheel-vp_d4jnx --python-tag cp37:
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\INTEL\AppData\Local\Temp\pip-req-build-bg_zxcrm\setup.py", line 290, in <module>
setup_package()
File "C:\Users\INTEL\AppData\Local\Temp\pip-req-build-bg_zxcrm\setup.py", line 286, in setup_package
setup(**metadata)
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "C:\Users\INTEL\AppData\Local\Temp\pip-req-build-bg_zxcrm\setup.py", line 174, in configuration
config.add_subpackage('sklearn')
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\numpy\distutils\misc_util.py", line 1037, in add_subpackage
caller_level = 2)
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\numpy\distutils\misc_util.py", line 1006, in get_subpackage
caller_level = caller_level + 1)
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\numpy\distutils\misc_util.py", line 943, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "sklearn\setup.py", line 81, in configuration
maybe_cythonize_extensions(top_path, config)
File "C:\Users\INTEL\AppData\Local\Temp\pip-req-build-bg_zxcrm\sklearn\_build_utils\__init__.py", line 43, in maybe_cythonize_extensions
with_openmp = check_openmp_support()
File "C:\Users\INTEL\AppData\Local\Temp\pip-req-build-bg_zxcrm\sklearn\_build_utils\openmp_helpers.py", line 84, in check_openmp_support
extra_postargs=openmp_flags)
File "C:\PROGRAMDATA\ANACONDA3\lib\distutils\_msvccompiler.py", line 345, in compile
self.initialize()
File "C:\PROGRAMDATA\ANACONDA3\lib\distutils\_msvccompiler.py", line 238, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\setuptools\msvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\setuptools\msvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Running setup.py clean for scikit-learn
Failed to build scikit-learn
Installing collected packages: scikit-learn
Found existing installation: scikit-learn 0.20.1
Uninstalling scikit-learn-0.20.1:
Failed building wheel for scikit-learn
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\scikit_learn-0.20.1-py3.7.egg-info\\dependency_links.txt'
Consider using the `--user` option or check the permissions.
After getting a similar error I was able to install scikit-learn by following the instructions from the official site https://scikit-learn.org/stable/install.html.
Error caused by file path length limit on Windows
It can happen that pip fails to install packages when reaching the default path size limit of Windows if Python is installed in a nested location such as the AppData folder structure under the user home directory, for instance:
Collecting scikit-learn
...
Installing collected packages: scikit-learn
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\sklearn\\datasets\\tests\\data\\openml\\292\\api-v1-json-data-list-data_name-australian-limit-2-data_version-1-status-deactivated.json.gz'
In this case it is possible to lift that limit in the Windows registry by using the regedit tool:
Type “regedit” in the Windows start menu to launch regedit.
Go to the Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem key.
Edit the value of the LongPathsEnabled property of that key and set it to 1.
Reinstall scikit-learn (ignoring the previous broken installation):
pip install --exists-action=i scikit-learn

pip install web3 # ubuntu error - cannot install web3

I'm having the following issue when trying to install web3 from pip:
$ sudo pip install web3
The directory '/home/chris/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/chris/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting web3
Downloading https://files.pythonhosted.org/packages/96/76/6313b5d55edb5ac6fdbde9beacafefb04fccd692348ed2085856c95dda25/web3-4.1.0.tar.gz (85kB)
100% |████████████████████████████████| 92kB 1.4MB/s
Collecting cytoolz<1.0.0,>=0.9.0 (from web3)
Downloading https://files.pythonhosted.org/packages/36/f4/9728ba01ccb2f55df9a5af029b48ba0aaca1081bbd7823ea2ee223ba7a42/cytoolz-0.9.0.1.tar.gz (443kB)
100% |████████████████████████████████| 450kB 3.6MB/s
Collecting eth-abi<2,>=1.0.0 (from web3)
Downloading https://files.pythonhosted.org/packages/8d/f1/212b138e8e2e46788054b456a068ae060f07464fd03f5f7ec0eb749c35d0/eth-abi-1.0.0.tar.gz
Collecting eth-account==0.1.0-alpha.2 (from web3)
Downloading https://files.pythonhosted.org/packages/57/8e/12a906f171f2860c0baf0f07bde4d7b390a3eacb29adc8341c7bbec356f6/eth-account-0.1.0a2.tar.gz
Collecting eth-utils<2.0.0,>=1.0.1 (from web3)
Downloading https://files.pythonhosted.org/packages/6f/08/0787c6ccb1b8dca4a15c12f67ed3d383f9f361eeb1836d6fe698caf46bca/eth-utils-1.0.3.tar.gz
Collecting hexbytes<1.0.0,>=0.1.0 (from web3)
Downloading https://files.pythonhosted.org/packages/81/15/fcd3a5ad583673ce52f0aac8e1246b91e7c88acbeae47863c30bfb264436/hexbytes-0.1.0.tar.gz
Complete output from command python setup.py egg_info:
zip_safe flag not set; analyzing archive contents...
pypandoc.__init__: module references __file__
Installed /tmp/pip-install-KPGcEs/hexbytes/.eggs/pypandoc-1.4-py2.7.egg
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-KPGcEs/hexbytes/setup.py", line 67, in <module>
'Programming Language :: Python :: Implementation :: PyPy',
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 372, in __init__
_Distribution.__init__(self, attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 528, in finalize_options
ep.load()(self, ep.name, value)
File "/tmp/pip-install-KPGcEs/hexbytes/.eggs/setuptools_markdown-0.2-py2.7.egg/setuptools_markdown.py", line 22, in long_description_markdown_filename
output = pypandoc.convert(markdown_filename, 'rst')
File "/tmp/pip-install-KPGcEs/hexbytes/.eggs/pypandoc-1.4-py2.7.egg/pypandoc/__init__.py", line 66, in convert
raise RuntimeError("Format missing, but need one (identified source as text as no "
RuntimeError: Format missing, but need one (identified source as text as no file with that name was found).
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-KPGcEs/hexbytes/
So whenever I try the .py script, I'm getting the following error:
from web3 import Web3, KeepAliveRPCProvider, IPCProvider
ImportError: cannot import name Web3
Any idea what could be causing this, or how to solve it?
I was able to solve that issue by moving web3==4.1.0 into a requirements.txt file and running pip install -r requirements.txt.
No idea why it worked. It still fails on attempts to install it from a setup.py file though.
By the way, according to web3 README they support only python 3.5+.

Unable to install twisted inside virtualenv on ubuntu 12.04

I am trying to install twisted inside virtualenv, everything seems to go fine but at the end this error is displayed.
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-14YOyA/twisted/
The OS is ubuntu 12.04, does someone have any idea ?
here is the displayed text:
(solidwork)root#rico-TravelMate-5744Z:/home/rico# pip install twisted
Collecting twisted
/home/rico/solidwork/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
SNIMissingWarning
/home/rico/solidwork/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
Downloading Twisted-17.9.0.tar.bz2 (3.0MB)
100% |████████████████████████████████| 3.0MB 77kB/s
Complete output from command python setup.py egg_info:
Couldn't find index page for 'incremental' (maybe misspelled?)
No local packages or download links found for incremental>=16.10.1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-14YOyA/twisted/setup.py", line 21, in <module>
setuptools.setup(**_setup["getSetupArgs"]())
File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/dist.py", line 221, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/dist.py", line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 821, in best_match
return self.obtain(req, installer) # try and download/install
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 833, in obtain
return installer(requirement)
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/dist.py", line 294, in fetch_build_egg
return cmd.easy_install(req)
File "/home/rico/solidwork/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/easy_install.py", line 583, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-14YOyA/twisted/

errors trying to installing "wireless" with pip

I am trying to install "wireless" with pip. I am not sure why it isn't working. I have tried using sudo's -H flag but nontheless I'm still getting the same errors. I am running Mac OSX Yosemite.
sudo pip install wireless
The directory '/Users/student/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/student/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting wireless
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading wireless-0.3.2.tar.gz
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/Library/Python/2.7/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/Library/Python/2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

Cannot update spyder due to SNI warning

I have python 2.7.6 with spyder 2.2.5 on Ubuntu 14.04.5. I couldn't connect to Ipython console so I decide to update spyder:
pip install spyder --upgrade
It throws the following errors. The text of the top one is:
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
Full stack trace:
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting spyder
Downloading spyder-3.1.4-py2-none-any.whl (3.5MB)
100% |████████████████████████████████| 3.5MB 387kB/s
Requirement already up-to-date: pygments>=2.0 in /usr/local/lib/python2.7/dist-packages (from spyder)
Requirement already up-to-date: jedi>=0.9.0 in /usr/local/lib/python2.7/dist-packages (from spyder)
Requirement already up-to-date: pyflakes in /usr/local/lib/python2.7/dist-packages (from spyder)
Requirement already up-to-date: pylint in /usr/local/lib/python2.7/dist-packages (from spyder)
Requirement already up-to-date: nbconvert in /usr/local/lib/python2.7/dist-packages (from spyder)
Requirement already up-to-date: qtpy>=1.1.0 in /usr/local/lib/python2.7/dist-packages (from spyder)
Requirement already up-to-date: pyzmq in /usr/local/lib/python2.7/dist-packages (from spyder)
Collecting numpydoc (from spyder)
Downloading numpydoc-0.6.0.tar.gz
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/usr/local/lib/python2.7/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/local/lib/python2.7/dist-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
I tried install some other packages like ndg-httpsclient, urllib3[secure] without luck. It throws exactly the same error. I cannot upgrade python itself. Can somebody help?
Note: I do have python-dev libffi-dev libssl-dev already installed.
It turns out that my requirements.py has problem (as the error suggests). I don't know if it causes future harm but adding an empty string to MARKER_EXPR() function fixes it.
MARKER_EXPR = originalTextFor(MARKER_EXPR(""))("marker")

Categories