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

Failed to install packages in virtual environment created by pipenv shell (with the verbose log) #4503

Closed
liuruenshen opened this issue Oct 28, 2020 · 2 comments

Comments

@liuruenshen
Copy link

Hi, I am new to the python ecosystem. I got the same issue as the ticket mentioned below:
#1356

So I try to log all the possible messages down here with the settings. Hopefully, that would be useful to find out the root cause.
Because this is the company's repository, some private information I need to hide shouldn't interfere with solving the issue.

Settings:
Pipfile
Pipfile.lock

Virtual Environment Information (pipenv shell):

± |master ?:2 ✗| → pipenv --version
pipenv, version 11.9.0

 2020-10-28 10:05:40 ⌚  MEC-209 in ~/git-repo/mop_service
± |master ?:2 ✗| → pip --version
pip 20.0.2 from /home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/pip (python 3.6)

 2020-10-28 10:06:02 ⌚  MEC-209 in ~/git-repo/mop_service
± |master ?:2 ✗| → python --version
Python 3.6.12

My apologies for not providing the information retrieved frompipenv --support. Because it complains about the flag is not available. I install pipenv by apt-get in ubuntu, which may not be the latest version.

I turn on the verbose mode to log all the message by executing the following command:

 pipenv install -v > debug.txt 2>&1

The logs list below:
pipenv install log

It is what happened when installing blinker(version=1.4) at line 785-946

Non-user install because user site-packages disabled
Created temporary directory: /tmp/pip-ephem-wheel-cache-s42qxhqj
Created temporary directory: /tmp/pip-req-tracker-e1y_en3v
Initialized build tracking at /tmp/pip-req-tracker-e1y_en3v
Created build tracker: /tmp/pip-req-tracker-e1y_en3v
Entered build tracker: /tmp/pip-req-tracker-e1y_en3v
Created temporary directory: /tmp/pip-install-u9wqb2kv
1 location(s) to search for versions of blinker:
* https://pypi.org/simple/blinker/
Fetching project page and analyzing links: https://pypi.org/simple/blinker/
Getting page https://pypi.org/simple/blinker/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/blinker/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/blinker/ HTTP/1.1" 304 0
  Found link https://files.pythonhosted.org/packages/66/6e/59a9fcfdaea1b6f16654b7242687e292b34aa145ece7520bc3b0649a1443/blinker-0.8.tar.gz#sha256=262256946fc67237de1f974261aab30cd1ece8b4fce251909b2bdd18318b1ed4 (from https://pypi.org/simple/blinker/), version: 0.8
  Found link https://files.pythonhosted.org/packages/f7/6a/d6fe7d2ee708e019ff36cfee72567bab2b4255a38e825056d91f801b1e76/blinker-0.9.tar.gz#sha256=564feb8981c69c8cb9eae7b08be864ebed60ab8c57e98429bf72765d68dcda26 (from https://pypi.org/simple/blinker/), version: 0.9
  Found link https://files.pythonhosted.org/packages/5d/a7/cd7c985c1ce71c64f443fa2d46d93c6986505606982093d7d0cb9d79ff3e/blinker-1.0.tar.gz#sha256=be3495250e7a5bdf8b5cd0fcd4f3a3e235b74f7209581283ece9ca14d77a71a6 (from https://pypi.org/simple/blinker/), version: 1.0
  Found link https://files.pythonhosted.org/packages/0e/1b/4696208d895d71539aaecece524d8a0d38de86ae4a3299150b8622353a68/blinker-1.1.zip#sha256=429a2b7433715b0c9bceb65aa0a93181d57f3548f89b9794697bedeb6b513a8f (from https://pypi.org/simple/blinker/), version: 1.1
  Found link https://files.pythonhosted.org/packages/bf/92/b8c23de91e995d0f0245c5ebbae0e8a803bc1811be15921258a15efa1df5/blinker-1.2.tar.gz#sha256=7062c05e9f724e2208835e335df5ffdc169004fe372ca91fb6408cd0f8e3aa85 (from https://pypi.org/simple/blinker/), version: 1.2
  Found link https://files.pythonhosted.org/packages/c9/66/c15dbe2e2cac59bf1d4670d52aa88b8746fd5a47f8353aa4ffac0dde00c4/blinker-1.3.tar.gz#sha256=6811010809262261e41ab7b92f3f6d23f35cf816fbec2bc05077992eebec6e2f (from https://pypi.org/simple/blinker/), version: 1.3
  Found link https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz#sha256=471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6 (from https://pypi.org/simple/blinker/), version: 1.4
Checked 1 links for project 'blinker' against 1 hashes (1 matches, 0 no digest): discarding no candidates
Using version 1.4 (newest of versions: 1.4)
Collecting blinker==1.4
  Created temporary directory: /tmp/pip-unpack-ar02fijl
  Looking up "https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz" in the cache
  Current age based on date: 58822
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 58822
  Using cached blinker-1.4.tar.gz (111 kB)
  Added blinker==1.4 from https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz#sha256=471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6 (from -r /tmp/pipenv-jeu70l6p-requirements/pipenv-ihh8raia-requirement.txt (line 1)) to build tracker '/tmp/pip-req-tracker-e1y_en3v'
    Running setup.py (path:/tmp/pip-install-u9wqb2kv/blinker/setup.py) egg_info for package blinker
    Running command python setup.py egg_info
    running egg_info
    creating /tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info
    writing /tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info/top_level.txt
    writing manifest file '/tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info/SOURCES.txt'
    reading manifest file '/tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file '/tmp/pip-install-u9wqb2kv/blinker/pip-egg-info/blinker.egg-info/SOURCES.txt'
  Source in /tmp/pip-install-u9wqb2kv/blinker has version 1.4, which satisfies requirement blinker==1.4 from https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz#sha256=471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6 (from -r /tmp/pipenv-jeu70l6p-requirements/pipenv-ihh8raia-requirement.txt (line 1))
  Removed blinker==1.4 from https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz#sha256=471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6 (from -r /tmp/pipenv-jeu70l6p-requirements/pipenv-ihh8raia-requirement.txt (line 1)) from build tracker '/tmp/pip-req-tracker-e1y_en3v'
Building wheels for collected packages: blinker
  Created temporary directory: /tmp/pip-wheel-92l_lbwu
  Building wheel for blinker (setup.py): started
  Destination directory: /tmp/pip-wheel-92l_lbwu
  Running command /home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u9wqb2kv/blinker/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u9wqb2kv/blinker/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 /tmp/pip-wheel-92l_lbwu
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/blinker
  copying blinker/_utilities.py -> build/lib/blinker
  copying blinker/base.py -> build/lib/blinker
  copying blinker/__init__.py -> build/lib/blinker
  copying blinker/_saferef.py -> build/lib/blinker
  warning: build_py: byte-compiling is disabled, skipping.

  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-u9wqb2kv/blinker/setup.py", line 38, in <module>
      'Topic :: Utilities',
    File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 259, in run
      self.run_command('install')
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
      return orig.install.run(self)
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/command/install.py", line 557, in run
      self.run_command(cmd_name)
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 973, in run_command
      cmd_obj.ensure_finalized()
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 107, in ensure_finalized
      self.finalize_options()
    File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 17, in finalize_options
      self.set_undefined_options('install',('install_layout','install_layout'))
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 290, in set_undefined_options
      setattr(self, dst_option, getattr(src_cmd_obj, src_option))
    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 103, in __getattr__
      raise AttributeError(attr)
  AttributeError: install_layout
  Building wheel for blinker (setup.py): finished with status 'error'
  ERROR: Failed building wheel for blinker
  Running setup.py clean for blinker
  Running command /home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u9wqb2kv/blinker/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u9wqb2kv/blinker/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
  running clean
  removing 'build/lib' (and everything under it)
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.6' does not exist -- can't clean it
  removing 'build'
Failed to build blinker
Installing collected packages: blinker
  Created temporary directory: /tmp/pip-record-wylhnpoh
    Running setup.py install for blinker: started
    Running command /home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u9wqb2kv/blinker/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u9wqb2kv/blinker/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wylhnpoh/install-record.txt --single-version-externally-managed --compile --install-headers /home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/include/site/python3.6/blinker
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/blinker
    copying blinker/_utilities.py -> build/lib/blinker
    copying blinker/base.py -> build/lib/blinker
    copying blinker/__init__.py -> build/lib/blinker
    copying blinker/_saferef.py -> build/lib/blinker
    warning: build_py: byte-compiling is disabled, skipping.

    running install_lib
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-u9wqb2kv/blinker/setup.py", line 38, in <module>
        'Topic :: Utilities',
      File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/command/install.py", line 557, in run
        self.run_command(cmd_name)
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/dist.py", line 973, in run_command
        cmd_obj.ensure_finalized()
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/home/kiwi/.local/share/virtualenvs/mop_service-Nv_zEphA/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 17, in finalize_options
        self.set_undefined_options('install',('install_layout','install_layout'))
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 290, in set_undefined_options
        setattr(self, dst_option, getattr(src_cmd_obj, src_option))
      File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 103, in __getattr__
        raise AttributeError(attr)
    AttributeError: install_layout
    Running setup.py install for blinker: finished with status 'error'
Cleaning up...
  Removing source in /tmp/pip-install-u9wqb2kv/blinker

Then I thought maybe I could use pip to install blinker, but it is still failed:

 pip install -v --install-option="--prefix=$(pipenv --venv)/lib/python3.6" blinker==1.4

And here is the log:
Pip install blinker failed in the virtual environment created by pipenv shell

I notice that both have failed in the same place:

    File "/home/kiwi/.pyenv/versions/3.6.12/lib/python3.6/distutils/cmd.py", line 103, in __getattr__
      raise AttributeError(attr)

I don't know what else I can do, so I exit the virtual environment, using pyenv to switch python to 3.6.12, which is the same as in the virtual environment, then using pip to install it again in my host environment, and it's ok.

# run in my host environment
pip install -v blinker==1.4

Install blinker by pip in the host environment

That is so far I can provide; if there is a lack of something, please let me know. Thanks.

@Mause
Copy link

Mause commented Oct 28, 2020

Please install pipenv via pip, the one available via apt-get is many years out of date

@liuruenshen
Copy link
Author

liuruenshen commented Oct 28, 2020

Sorry, My mistake, I saw the first line of the installation part says using apt to install pipenv, not be aware that it is only for Debian.

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

3 participants