".dist-info directory not found" with pipenv install -r requirements.txt - python

I'm trying to install snapcraft's requirements using:
pipenv install -r snapcraft/requirements.txt
and it fails to install those two dependencies:
https://launchpad.net/ubuntu/+archive/primary/+files/python-apt_1.1.0~beta1build1.tar.xz
https://launchpad.net/python-distutils-extra/trunk/2.39/+download/python-distutils-extra-2.39.tar.gz
Collecting f3a5fdd from https://launchpad.net/ubuntu/+archive/primary/+files/python-apt_1.1.0~beta1build1.tar.xz#egg=f3a5fdd
Installing collected packages: f3a5fdd
Exception:
Traceback (most recent call last):
File "/media/fgervais/core/.venv/lib/python3.5/site-packages/pip/_internal/basecommand.py", line 228, in main
status = self.run(options, args)
File "/media/fgervais/core/.venv/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 335, in run
use_user_site=options.use_user_site,
File "/media/fgervais/core/.venv/lib/python3.5/site-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
**kwargs
File "/media/fgervais/core/.venv/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 748, in install
use_user_site=use_user_site, pycompile=pycompile,
File "/media/fgervais/core/.venv/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 961, in move_wheel_files
warn_script_location=warn_script_location,
File "/media/fgervais/core/.venv/lib/python3.5/site-packages/pip/_internal/wheel.py", line 316, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: f3a5fdd .dist-info directory not found
Any body know where #egg=f3a5fdd is coming from?
I think this is what cause the issue because this works:
pipenv shell
pip3 install https://launchpad.net/ubuntu/+archive/primary/+files/python-apt_1.1.0~beta1build1.tar.xz
but if I add #egg=f3a5fdd it fails with the same error as pipenv.

Related

Pip Error Offline Installation from a Requirements.txt?

I'm trying to install Rasa (it's a python pip package) in a Ubuntu VM that has no internet connection. I use a requirements.txt to install rasa completely offline. The requirements.txt and the packages (.whl files) are in the same folder. I use following command:
pip install --no-index --find-links /home/...(folder with .whl files) -r requirements.txt
It collects the dependencies but stops after the "tensorflow" package. Here's the log:
(venv) [user#ubuntuvm alldependencies]$ pip install --no-index --find-links /home/user/alldependencies/ -r requirements.txt
Looking in links: /home/user/alldependencies/
Processing ./absl_py-0.10.0-py3-none-any.whl
[ PROCESSING bla bla....]
Processing ./tensorboard-2.3.0-py3-none-any.whl
Processing ./tensorboard_plugin_wit-1.7.0-py3-none-any.whl
Processing ./tensorflow-2.3.1-py3-none-any.whl
ERROR: Exception:
Traceback (most recent call last):
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
status = self.run(options, args)
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
return func(self, options, args)
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/commands/install.py", line 324, in run
reqs, check_supported_wheels=not options.target_dir
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 391, in _resolve_one
dist = abstract_dist.get_pkg_resources_distribution()
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/distributions/wheel.py", line 29, in get_pkg_resources_distribution
with ZipFile(self.req.local_file_path, allowZip64=True) as z:
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/zipfile.py", line 1108, in __init__
self._RealGetContents()
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/zipfile.py", line 1175, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
What can I do? I installed Python 3.6 and the newest Pip Version (20.x).
Looks like the tensorflow-2.3.1-py3-none-any.whl is corrupted. Possible causes are: something went wrong during the download or during the write on disk of this file. Most likely downloading it again would solve the issue.

Python pip - Cant update pip

I tried upgrading pip on python version 3.6 but failed
I used this command:
python -m pip install --upgrade pip
And got this error:
C:\Users\home>python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Successfully uninstalled pip-7.1.2
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\commands\install.py", line 311, in run
root=options.root_path,
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\req\req_set.py", line 646, in install
**kwargs
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\req\req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\req\req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\wheel.py", line 449, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\distlib\scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\distlib\scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\distlib\scripts.py", line 193, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\distlib\scripts.py", line 332, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\home\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
easy_install --upgrade pip solved it

pip fails in installing package

does anyone know what could be wrong here? I am trying to install my own python package, but getting:
c:\Python\Python36\Scripts>pip install --index-url yyy xxx
Looking in indexes: yyy
Collecting xxx
Installing collected packages: xxx
Exception:
Traceback (most recent call last):
File "c:\python\python36\lib\site-packages\pip\_internal\cli\base_command.py",
line 143, in main
status = self.run(options, args)
File "c:\python\python36\lib\site-packages\pip\_internal\commands\install.py",
line 366, in run
use_user_site=options.use_user_site,
File "c:\python\python36\lib\site-packages\pip\_internal\req\__init__.py", lin
e 49, in install_given_reqs
**kwargs
File "c:\python\python36\lib\site-packages\pip\_internal\req\req_install.py",
line 760, in install
use_user_site=use_user_site, pycompile=pycompile,
File "c:\python\python36\lib\site-packages\pip\_internal\req\req_install.py",
line 382, in move_wheel_files
warn_script_location=warn_script_location,
File "c:\python\python36\lib\site-packages\pip\_internal\wheel.py", line 326,
in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: xxx .dist-info directory not found
What could be wrong with python or pip and why I am getting:
AssertionError: xxx .dist-info directory not found?
Delete your Pip caches, that's because regardless of whether you use a venv or your system interpreter if you are using Pip as a package manager it always caches parts of the packages in the computer.
To see where the caches are for your OS PyPi Caching.

Python PIP giving error - "AttributeError: 'module' object has no attribute 'ip_address'"

I am actually having a problem with installing any modules using PIP. Whenever I run PIP like
pip install module_name
OR
sudo pip install module-name
" then it'll show an error like this:-
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 294, in run
requirement_set.prepare_files(finder)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 461, in _prepare_file
req_to_install.populate_link(finder, self.upgrade)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 250, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/index.py", line 486, in find_requirement
all_versions = self._find_all_versions(req.name)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/index.py", line 425, in _find_all_versions
if self._validate_secure_origin(logger, link)
File "/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/index.py", line 301, in _validate_secure_origin
addr = ipaddress.ip_address(
AttributeError: 'module' object has no attribute 'ip_address'
Importantly:-
AttributeError: 'module' object has no attribute 'ip_address
Reinstalling does nothing
I fixed it by using the following commands:
$ sudo easy_install --upgrade pip
...
Installed /usr/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
$ sudo pip uninstall requests
...
Successfully uninstalled requests-1.1.0
$ sudo pip install requests
...
Successfully installed requests-2.12.4
$ pip install --upgrade pyOpenSSL

Python Pip Install "Egg" Error (Pandas and other modules)

Having issues installing some python modules (for example pandas) and also had some issues installing ipython notebook.
This error seems to have come up before for other folks (Python pip install fails: invalid command egg_info), but they were using Python 2.7, whereas I'm using 2.6 (default with my Mac OS 10.6). Also I tried easy_install -U setuptools and pip install --upgrade setuptools but neither worked.
This is the error I get for installing pandas:
Command python setup.py egg_info failed with error code 1 in /private/var/folders/Wm/WmmbYincEnuCrAMtGBudAk+++TM/-Tmp-/pip_build_AWal/pandas
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log
For installing iPython, this is the error that I get:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/wheel.py", line 341, in move_wheel_files
generated.extend(maker.make_multiple(['%s = %s' % kv for kv in console.items()]))
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 316, in make_multiple
filenames.extend(self.make(specification, options))
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 305, in make
self._make_script(entry, filenames, options=options)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 209, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 189, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/util.py", line 384, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/sphinx-apidoc'
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log
Any thoughts on what to do?
UPDATE:
When I do sudo pip install pandas (another module that I can't install), I get a long long traceback with the end error message:
RuntimeError: Broken toolchain: cannot link a simple C program
And traceback (a sample of it of the 100 or so lines) looks like this:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/pandas/setup.py", line 619, in <module>
**setuptools_kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 266, in __init__
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 312, in fetch_build_eggs
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 753, in resolve
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1005, in best_match
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1017, in obtain
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 379, in fetch_build_egg
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 619, in easy_install
A permission Denied message would suggest you to run your command as root as suggested by Hackaholic.
try sudo pip install YOUR_PACKAGE
You might also want to have a look at virtualenv to use a more isolated environment.
Under debian based distributions, you might install python-virtualenv package with apt-get install python-virtualenv.
Then create a virtual environment names whatever by typing virtualenv whatever (this will create a folder whatever inside your current folder.
Then cd to it and type bin/activate to enter this virtual environment.
From there try again your pip install command.
Might help
UPDATE :
You might try to use the suggested solutions available here
To sumup, try to add export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future inside ~/.bash_profile
This question comes first in Google, but the second one actually worked:
pip install -U setuptools
pip install ez_setup

Categories