Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting error when installing package using pipenv. #1035

Closed
RatanShreshtha opened this issue Nov 6, 2017 · 15 comments
Closed

I am getting error when installing package using pipenv. #1035

RatanShreshtha opened this issue Nov 6, 2017 · 15 comments

Comments

@RatanShreshtha
Copy link

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/

@techalchemy
Copy link
Member

Can you upgrade to the latest release of pipenv and let us know if this is still an issue?

@RatanShreshtha
Copy link
Author

I tried upgrading my pipenv using sudo pip install -U pipenv but I am getting following error:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 365, in run
    strip_file_prefix=options.strip_file_prefix,
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 854, in install
    strip_file_prefix=strip_file_prefix
  File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 1069, in move_wheel_files
    strip_file_prefix=strip_file_prefix,
  File "/usr/lib/python2.7/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/lib/python2.7/site-packages/pip/locations.py", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 365, in __init__
    self._finalize_requires()
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 372, in _finalize_requires
    if not self.install_requires:
AttributeError: Distribution instance has no attribute 'install_requires'

@RatanShreshtha
Copy link
Author

So I removed the pipenv and reinstalled it agian now I am using **pipenv**, version 8.3.2 and now I am unable to install any package using pipenv.

@techalchemy
Copy link
Member

techalchemy commented Nov 7, 2017 via email

@iandanforth
Copy link

Also hitting this:

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1866, in install
    do_init(dev=dev, allow_global=system, ignore_pipfile=ignore_pipfile, system=system, skip_lock=skip_lock, verbose=verbose, concurrent=concurrent, deploy=deploy, pre=pre)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1330, in do_init
    do_lock(system=system, pre=pre)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1121, in do_lock
    pre=pre
  File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 461, in resolve_deps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/resolver.py", line 200, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/resolver.py", line 296, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in get_dependencies
    result = reqset._prepare_file(self.finder, ireq)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/req/req_set.py", line 639, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python2.7/dist-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/tmpaKwDy5build/bcolz/

Pipfile

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[dev-packages]



[packages]

bcolz = ">=1.1.2"
bleach = ">=2.0.0"
certifi = ">=2016.2.28"
Cycler = ">=0.10.0"
decorator = ">=4.1.2"
entrypoints = ">=0.2.3"
"html5lib" = ">=0.999999999"
ipykernel = ">=4.6.1"
ipython = ">=6.2.0"
ipython_genutils = ">=0.2.0"
ipywidgets = ">=7.0.1"
jedi = ">=0.10.2"
"Jinja2" = ">=2.9.6"
jsonschema = ">=2.6.0"
jupyter = ">=1.0.0"
jupyter_client = ">=5.1.0"
jupyter_console = ">=5.2.0"
jupyter_core = ">=4.3.0"
MarkupSafe = ">=1.0"
matplotlib = ">=2.0.2"
mistune = ">=0.7.4"
nbconvert = ">=5.3.1"
nbformat = ">=4.4.0"
notebook = ">=5.1.0"
numpy = ">=1.13.1"
olefile = ">=0.44"
opencv-python = ">=3.3.0.10"
pandas = ">=0.20.3"
pandocfilters = ">=1.4.2"
pexpect = ">=4.2.1"
pickleshare = ">=0.7.4"
Pillow = ">=4.2.1"
prompt_toolkit = ">=1.0.15"
ptyprocess = ">=0.5.2"
pygments = ">=2.2.0"
pyparsing = ">=2.2.0"
python-dateutil = ">=2.6.1"
pytz = ">=2017.2"
PyYAML = ">=3.12"
pyzmq = ">=16.0.2"
qtconsole = ">=4.3.1"
scipy = ">=0.19.1"
seaborn = ">=0.8.1"
simplegeneric = ">=0.8.1"
terminado = ">=0.6"
testpath = ">=0.3.1"
tornado = ">=4.5.2"
tqdm = ">=4.15.0"
traitlets = ">=4.3.2"
wcwidth = ">=0.1.7"
webencodings = ">=0.5.1"
widgetsnbextension = ">=3.0.3"


[requires]

python_version = "3.4"

@iandanforth
Copy link

Note the above Pipfile was automatically created by pipenv --three in a repo with this requirements.txt

bcolz>=1.1.2
bleach>=2.0.0
certifi>=2016.2.28
cycler>=0.10.0
decorator>=4.1.2
entrypoints>=0.2.3
html5lib>=0.999999999
ipykernel>=4.6.1
ipython>=6.2.0
ipython-genutils>=0.2.0
ipywidgets>=7.0.1
jedi>=0.10.2
Jinja2>=2.9.6
jsonschema>=2.6.0
jupyter>=1.0.0
jupyter-client>=5.1.0
jupyter-console>=5.2.0
jupyter-core>=4.3.0
MarkupSafe>=1.0
matplotlib>=2.0.2
mistune>=0.7.4
nbconvert>=5.3.1
nbformat>=4.4.0
notebook>=5.1.0
numpy>=1.13.1
olefile>=0.44
opencv-python>=3.3.0.10
pandas>=0.20.3
pandocfilters>=1.4.2
pexpect>=4.2.1
pickleshare>=0.7.4
Pillow>=4.2.1
prompt-toolkit>=1.0.15
ptyprocess>=0.5.2
Pygments>=2.2.0
pyparsing>=2.2.0
python-dateutil>=2.6.1
pytz>=2017.2
PyYAML>=3.12
pyzmq>=16.0.2
qtconsole>=4.3.1
scipy>=0.19.1
seaborn>=0.8.1
simplegeneric>=0.8.1
six>=1.11.0
terminado>=0.6
testpath>=0.3.1
tornado>=4.5.2
tqdm>=4.15.0
traitlets>=4.3.2
wcwidth>=0.1.7
webencodings>=0.5.1
widgetsnbextension>=3.0.3

@iandanforth
Copy link

More info:

lsb_release -a

lsb_release -a
LSB Version:	core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.5 LTS
Release:	14.04
Codename:	trusty

python --version

Python 2.7.6

python3 --version

Python 3.4.3

pipenv --version

pipenv, version 8.3.2

pip --version (external to env)

pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

pop --version (within env)

pip 9.0.1 from /home/idanforth/.local/share/virtualenvs/fastai-eJJZx2IL/lib/python3.4/site-packages

@iandanforth
Copy link

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?

@techalchemy
Copy link
Member

@iandanforth anything is possible although passing in --verbose to your install command might generate more output. You can also make a new virtualenv and install with pip directly and debug from there, but I'm going to go ahead and close this issue since it's not an error with pipenv. If and when we get to the bottom of the cause we can see about bubbling up a more informative error

@bikeshedder
Copy link

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! :-)

@bikeshedder
Copy link

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?

@colllin
Copy link

colllin commented Jul 17, 2018

Edited: @iandanforth Sorry — missed your comment. Thanks!

@yonasyifter
Copy link

yonasyifter commented Jan 25, 2020

**_```
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"

@yonasyifter
Copy link

any one can help me with this
error..

@Stoomy
Copy link

Stoomy commented Sep 17, 2020

@yonasyifter , I think you need to sudo. You're getting a permission Error.

NOTE: I was getting this:

:stderr: Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 307, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 370, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 587, in _prepare_file
   .
   .
   .
  File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
    ).encode("utf8"),
MemoryError
You are using pip version 8.1.2, however version 20.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Which looks similar to some of the other errors here. Except for the "MemoryError" at the bottom. I was testing in AWS on a t2.micro instance which has about 1GB RAM. Moving to a larger ec2 instance fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants