question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'venv create' is failing with pip 10

See original GitHub issue

pyperformance venv create has started failing for me recently, with the following message:

Execute: venv/cpython3.6-a7d80a339c76/bin/python -m pip install
ERROR: You must give at least one requirement to install (see "pip help install")
Command venv/cpython3.6-a7d80a339c76/bin/python -m pip install failed with exit code 1

I think this may be due to a behaviour change in pip 10.

I’m using performance v0.6.1 .

Full output below.

Creating the virtual environment venv/cpython3.6-a7d80a339c76
Execute: /home/mjw/opt/python3.6/bin/python3.6 -m venv --without-pip venv/cpython3.6-a7d80a339c76
Execute: venv/cpython3.6-a7d80a339c76/bin/python -c 'import sys; print(sys.hexversion)'
Python hexversion: 30602f0
Execute: venv/cpython3.6-a7d80a339c76/bin/python -m ensurepip --verbose
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
  0 location(s) to search for versions of setuptools:
  Skipping link /tmp/tmpqak284a0 (from -f); not a file
  Skipping link file:///tmp/tmpqak284a0/pip-9.0.1-py2.py3-none-any.whl; wrong project name (not setuptools)
  Found link file:///tmp/tmpqak284a0/setuptools-28.8.0-py2.py3-none-any.whl, version: 28.8.0
  Local files found: /tmp/tmpqak284a0/setuptools-28.8.0-py2.py3-none-any.whl
  Using version 28.8.0 (newest of versions: 28.8.0)
Collecting pip
  0 location(s) to search for versions of pip:
  Found link file:///tmp/tmpqak284a0/pip-9.0.1-py2.py3-none-any.whl, version: 9.0.1
  Skipping link file:///tmp/tmpqak284a0/setuptools-28.8.0-py2.py3-none-any.whl; wrong project name (not pip)
  Local files found: /tmp/tmpqak284a0/pip-9.0.1-py2.py3-none-any.whl
  Using version 9.0.1 (newest of versions: 9.0.1)
Installing collected packages: setuptools, pip

  changing mode of /home/mjw/pyperf/venv/cpython3.6-a7d80a339c76/bin/easy_install-3.6 to 775

  changing mode of /home/mjw/pyperf/venv/cpython3.6-a7d80a339c76/bin/pip3 to 775
  changing mode of /home/mjw/pyperf/venv/cpython3.6-a7d80a339c76/bin/pip3.6 to 775
Successfully installed pip-9.0.1 setuptools-28.8.0
Cleaning up...
Execute: venv/cpython3.6-a7d80a339c76/bin/python -m pip --version
pip 9.0.1 from /home/mjw/pyperf/venv/cpython3.6-a7d80a339c76/lib/python3.6/site-packages (python 3.6)
Execute: venv/cpython3.6-a7d80a339c76/bin/python -m pip install -U 'setuptools>=18.5' 'pip>=6.0'
Collecting setuptools>=18.5
  Using cached https://files.pythonhosted.org/packages/20/d7/04a0b689d3035143e2ff288f4b9ee4bf6ed80585cc121c90bfd85a1a8c2e/setuptools-39.0.1-py2.py3-none-any.whl
Collecting pip>=6.0
  Using cached https://files.pythonhosted.org/packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl
Installing collected packages: setuptools, pip
  Found existing installation: setuptools 28.8.0
    Uninstalling setuptools-28.8.0:
      Successfully uninstalled setuptools-28.8.0
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-10.0.0 setuptools-39.0.1

Execute: venv/cpython3.6-a7d80a339c76/bin/python -m pip install -U wheel
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/1b/d2/22cde5ea9af055f81814f9f2545f5ed8a053eb749c08d186b369959189a8/wheel-0.31.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.31.0

Execute: venv/cpython3.6-a7d80a339c76/bin/python -m pip install
ERROR: You must give at least one requirement to install (see "pip help install")
Command venv/cpython3.6-a7d80a339c76/bin/python -m pip install failed with exit code 1

Remove directory venv/cpython3.6-a7d80a339c76

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
matthewwcommented, Apr 15, 2018

The following change was enough to work around the problem for me:

diff --git a/performance/venv.py b/performance/venv.py
index 0744e7b..c0980b5 100644
--- a/performance/venv.py
+++ b/performance/venv.py
@@ -495,9 +495,10 @@ def _install_req(self):
         self.run_cmd(cmd)
 
         # install indirect requirements
-        cmd = pip_program + ['install']
-        cmd.extend(requirements.indirect_req)
-        self.run_cmd(cmd)
+        if requirements.indirect_req:
+            cmd = pip_program + ['install']
+            cmd.extend(requirements.indirect_req)
+            self.run_cmd(cmd)
 
         # install requirements
         cmd = pip_program + ['install']
0reactions
vstinnercommented, Oct 16, 2018

Fixed by commit 439aabf631167ec418ced5a31dc664581d8f7c9c, I will release a new version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'venv create' is failing with pip 10 · Issue #40 · python ... - GitHub
I think this may be due to a behaviour change in pip 10. I'm using performance v0.6.1 . Full output below. Creating the...
Read more >
Cannot create venv for Python 3.10
Trying to create venv for Python 3.10 using "python3.10 -m venv venv get error message:.
Read more >
Pip is not found after creating new python virtual environment
your installed binary executable is named as pip3.10(/usr/bin/pip /home//venv/bin/pip3.10). So you should use the same name to call it, ...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ......
Read more >
Configure a virtual environment | PyCharm Documentation
PyCharm makes it possible to use the virtualenv tool to create a project-specific isolated virtual environment. The main purpose of virtual environments is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found