I am getting No files/directories in /tmp/* errors while I try to install any package on my Ubuntu 18.04.2 LTS/ Python 3.6.8 / Python 2.7.15+ machine.
For instance,
pip install pyx
Collecting pyx
Using cached https://files.pythonhosted.org/packages/f7/25/59c136568c1b61ee087155c874fcd9f7196a943a6a5ee3429efeb30ea2a8/PyX-0.15.tar.gz
No files/directories in /tmp/pip-build-nRurCC/pyx/pip-egg-info (from PKG-INFO)
This happens for every package I am trying to install.
sudo is not helping.
Solution presented here, using --no-cache-dir option, is not helping.
Output of running the pip install command with vvv option gives the following output.
No files/directories in /tmp/pip-build-VU1cex/pyx/pip-egg-info (from PKG-INFO)
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/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/lib/python2.7/dist-packages/pip/req/req_install.py", line 455, in run_egg_info
metadata_name = canonicalize_name(self.pkg_info()["Name"])
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 533, in pkg_info
data = self.egg_info_data('PKG-INFO')
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 471, in egg_info_data
filename = self.egg_info_path(filename)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 515, in egg_info_path
'No files/directories in %s (from %s)' % (base, filename)
InstallationError: No files/directories in /tmp/pip-build-VU1cex/pyx/pip-egg-info (from PKG-INFO)
I think it is an upstream issue I tried multiple things even installing using the latest commit pip install git+https://github.com/pyx-project/pyx.git#fc66c078727b02693b122ad346b9fa5472e06eb7, please try this version: pip install PyX==0.12 it should work.
If using pip 6.0 or newer, check if it works with the --no-cache-dir option.
You can also try to get a detailed output from pip using the -vvv argument
Source: https://stackoverflow.com/a/9510610/2542835
Apparently pip3 install x works for me. pip install x does not.
Related
I am trying to install off line the python pkgs - argparse-1.4.0-py2.py3-none-any.whl as the following
pip install --ignore-installed --no-index --find-links /pkgs/argparse-1.4.0-py2.py3-none-any.whl
Ignoring indexes: https://pypi.python.org/simple
You must give at least one requirement to install (maybe you meant "pip install /pkgs/argparse-1.4.0-py2.py3-none-any.whl"?)
but the installation failed on - Ignoring indexes: https://pypi.python.org/simpleIgnoring
what is the right way to install off-line ( without network internet ) the whl file - argparse-1.4.0-py2.py3-none-any.whl
we run the pip on rhel 7.x machines with python 2.7
we also tried the following but other error appears and without success
pip install --ignore-installed --no-index --find-links /pkgs argparse-1.4.0-py2.py3-none-any.whl
seems that the direction to the right syntax is
pip install --use-wheel --no-index --find-links="/pkgs" "argparse-1.4.0-py2.py3-none-any.whl"
but when I add the flag --ignore-installed as
pip install --ignore-installed --use-wheel --no-index --find-links="/pkgs" "argparse-1.4.0-py2.py3-none-any.whl"
then we get
exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 299, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 587, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/download.py", line 798, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/download.py", line 705, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "/usr/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 482, in unzip_file
zipfp = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: '/pkgs/argparse-1.4.0-py2.py3-none-any.whl'
is there any reason you need to ignore installed.
I don't know the exactly what causes the problem, but pip cannot see the file you are trying to install
some things that could be wrong:
Did you look if the file still exist after
pip install --use-wheel --no-index --find-links="/pkgs" "argparse-1.4.0-py2.py3 none-any.whl"
and it can be accessed by a command without root privilege.
Another reason for your problem could be that
--ignore-installed
forces pip to not use the file
I'm trying to install cryptography to my system, but I get this error:
WARNING: Missing build requirements in pyproject.toml for cryptography from https://files.pythonhosted.org/packages/07/ca/bc827c5e55918ad223d59d299fff92f3563476c3b00d0a9157d9c0217449/cryptography-2.6.1.tar.gz#sha256=26c821cbeb683facb966045e2064303029d572a87ee69ca5a1bf54bf55f93ca6.
WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'setuptools>=40.8.0' and 'wheel'.
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 178, in main
status = self.run(options, args)
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 352, in run
resolver.resolve(requirement_set)
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/resolve.py", line 131, in resolve
self._resolve_one(requirement_set, req)
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 368, in prepare_linked_requirement
abstract_dist.prep_for_dist(finder, self.build_isolation)
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 175, in prep_for_dist
self.install_backend_dependencies(finder=finder)
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 123, in install_backend_dependencies
reqs = req.pep517_backend.get_requires_for_build_wheel()
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/wrappers.py", line 71, in get_requires_for_build_wheel
'config_settings': config_settings
File "/data/packages/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/wrappers.py", line 162, in _call_hook
raise BackendUnavailable
pip._vendor.pep517.wrappers.BackendUnavailable
This is my setup:
Alpine Linux 3.6.2
Python 3.6.3
pip 19.1
wheel 0.33.1
setuptools 41.0.1
Any idea what could be the problem, or how to solve it?
Thanks for the help in advance!
I did not find any uniform solution to this problem. You can try the following troubleshooting steps. one of them should work.
Upgrade the pip version.
Change the library/package version.
If you are installing from source, try a different .whl package or use tar.gz.
Use --no-use-pep517 with your pip install command (didn't work for me though, but I see it worked for some).
I got the same error with a different library and --no-use-pep517 did not help. However this did:
python -m pip install --upgrade pip
I'm running python 3.5.3 on Windows
I tried using
pip install --upgrade tensorflow
and here's what i get back
Using cached tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
Requirement already up-to-date: wheel>=0.26 in
c:\users\max\miniconda3\lib\site-packages (from tensorflow)
Exception:
Traceback (most recent call last):
File "C:\Users\Max\Miniconda3\lib\site-packages\pip\basecommand.py", line
215, in main
status = self.run(options, args)
File "C:\Users\Max\Miniconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\Max\Miniconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\Max\Miniconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Max\Miniconda3\lib\site-packages\pip\req\req_set.py", line 666, in _prepare_file
check_dist_requires_python(dist)
File "C:\Users\Max\Miniconda3\lib\site-packages\pip\utils\packaging.py", line 48, in check_dist_requires_python
feed_parser.feed(metadata)
File "C:\Users\Max\Miniconda3\lib\email\feedparser.py", line 178, in feed
self._input.push(data)
File "C:\Users\Max\Miniconda3\lib\email\feedparser.py", line 104, in push
self._partial.write(data)
TypeError: string argument expected, got 'NoneType'
I've also tried
pip3 install --upgrade tensorflow
but I get back
'pip3' is not recognized as an internal or external command, operable program or batch file.
I'm not too sure what the error is, and googling hasn't gotten me any results
I also had the same issue. I'm using Anaconda, and I managed to install it with these commands:
conda create -n tensorflow
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
This worked for me, and probably this will work for miniconda too.
I am getting the following error, whenever I do virtualenv venv. I have installed virtualenv via sudo pip install --user virtualenv
New python executable in /Users/rajrohit/Desktop/Work/LambdaAnsible/TestLambda/venv/bin/python
Please make sure you remove any previous custom paths from your /Users/rajrohit/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
Complete output from command /Users/rajrohit/Desk...mbda/venv/bin/python - setuptools pip wheel:
Collecting setuptools
Using cached setuptools-34.2.0-py2.py3-none-any.whl
Collecting pip
Collecting wheel
Collecting packaging>=16.8 (from setuptools)
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools)
Using cached appdirs-1.4.0-py2.py3-none-any.whl
Collecting six>=1.6.0 (from setuptools)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools)
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Installing collected packages: six, pyparsing, packaging, appdirs, setuptools, pip, wheel
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 478, in move_wheel_files
generated.extend(maker.make(spec))
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 250, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 407, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 1] Operation not permitted: '/bin/easy_install'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 945, in create_environment
download=download,
File "/Library/Python/2.7/site-packages/virtualenv.py", line 901, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 797, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/rajrohit/Desk...mbda/venv/bin/python - setuptools pip wheel failed with error code 2
How do I work with this permissions error, and make virtualenv work properly?
I've always had permission issues when running/modifying the default OSX python interpreter. Currently I use PyEnv (https://github.com/yyuu/pyenv) which installs separate user modifiable python interpreters and together with pyenv-virtualenv (https://github.com/yyuu/pyenv-virtualenv) it works like a charm. I've never had issues since the change.
I recently had similar issues setting up a new machine, I found this solution worked best.
https://apple.stackexchange.com/a/209583/226131
A more detailed explanation is contained within the same question.
https://apple.stackexchange.com/a/223163/226131
TLDR: install a user-modifiable version of python brew install python then you can just pip install.
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