pipenv: I am getting error when installing package using pipenv.

I am trying to install coala-bears in a virtual environment using pipenv, I am getting error when using pipenv but I am able to install coala-bears using simple pip.

Describe your environment
  1. OS Type - Linux (Fedora - 26)
  2. Python version: Python 3.6.2
  3. Pipenv version: version 8.2.6
Expected result

coala-bears is installed with all its dependancies.

Actual result
Traceback (most recent call last):
  File "/usr/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==8.2.6', 'console_scripts', 'pipenv')()
  File "/usr/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pipenv/cli.py", line 1852, in install
    do_lock(system=system, pre=pre)
  File "/usr/lib/python2.7/site-packages/pipenv/cli.py", line 1083, in do_lock
    pre=pre
  File "/usr/lib/python2.7/site-packages/pipenv/utils.py", line 421, in resolve_deps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/usr/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 101, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 199, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 278, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/usr/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 171, in get_dependencies
    result = reqset._prepare_file(self.finder, ireq)
  File "/usr/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 639, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/lib/python2.7/site-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/lib/python2.7/site-packages/pipenv/patched/pip/utils/__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpIGoBs3build/functools32/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

I had the same error with pipenv and finally found the problem. When installing pipenv I used pip instead of pip3 so pipenv was installed using Python 2.7 and not 3.6.

Steps to reproduce:

pip install --user pipenv
pipenv --python 3.6
pipenv install connexion
# bails out with an error :-(

The error does not occur when installing pipenv using pip3:

pip uninstall pipenv
pip3 install --user pipenv
pipenv --python 3.6
pipenv install connexion
# no errors, horray! :-)

Maybe pipenv should produce a warning when it is running using Python 2.7 and tries to install packages for a Python 3.x environment?

Ok I’ve resolved this on two of my machines and have an idea what’s happening.

Fix:

sudo apt-get install python3.4-dev

Why this may be a fix:

When installing from a Pipfile a deeper error with installing bcolz is swallowed. That error points to missing Python header files.

Is it possible that that error leaves a tmp directory in a locked state which gives rise to the error code 1 aka permissions error?

**_``` Exception: Traceback (most recent call last): File “/home/hop/.local/lib/python3.6/site-packages/pip/basecommand.py”, line 215, in main status = self.run(options, args) File “/home/hop/.local/lib/python3.6/site-packages/pip/commands/install.py”, line 342, in run prefix=options.prefix_path, File “/home/hop/.local/lib/python3.6/site-packages/pip/req/req_set.py”, line 784, in install **kwargs File “/home/hop/.local/lib/python3.6/site-packages/pip/req/req_install.py”, line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File “/home/hop/.local/lib/python3.6/site-packages/pip/req/req_install.py”, line 1064, in move_wheel_files isolated=self.isolated, File “/home/hop/.local/lib/python3.6/site-packages/pip/wheel.py”, line 345, in move_wheel_files clobber(source, lib_dir, True) File “/home/hop/.local/lib/python3.6/site-packages/pip/wheel.py”, line 323, in clobber shutil.copyfile(srcfile, destfile) File “/usr/lib/python3.6/shutil.py”, line 121, in copyfile with open(dst, ‘wb’) as fdst: PermissionError: [Errno 13] Permission denied: ‘/usr/local/lib/python3.6/dist-packages/pip/main.py’ You are using pip version 9.0.2, however version 20.0.2 is available. You should consider upgrading via the ‘pip install --upgrade pip’ command.

i got this error when i tried  to upgrade pip

using command "pip  install --upgrade pip"