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

pyvenv is no longer compatible with Python built from source #540

Open
chrisjbremner opened this issue Mar 26, 2020 · 0 comments
Open

pyvenv is no longer compatible with Python built from source #540

chrisjbremner opened this issue Mar 26, 2020 · 0 comments

Comments

@chrisjbremner
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.56
  • Ruby: 2.4.4
  • Distribution: Ubuntu 16.04
  • Module version: 4.0.0

How to reproduce (e.g Puppet code you use)

  ::python::pyvenv { $venv_path :
    version => '3.7.6',
  }

What are you seeing

The virtualenv is not created because it cannot install the python3.7-venv package via apt. This is because my version of python3.7 was built from source, and therefore I didn't get the python3.7 package via apt. Since python3.7 is required to install python3.7-venv via apt, this fails.

When built from source, venv is already included, so an additional package containing the venv module is not necessary, so this step should be skipped.

What behaviour did you expect instead

I expected the virtualenv to be correctly created

Output log

Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install python3.7-venv' returned 100:
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python3.7-venv
E: Couldn't find any package by glob 'python3.7-venv'
E: Couldn't find any package by regex 'python3.7-venv'

Any additional information you'd like to impart

I believe that the best way to skip this step if necessary would be to check for the presence of the venv module. This could either be done using something like python3.7 -c "import venv" or pydoc3.7 venv, or checking if the folder exists at /usr/local/lib/python3.7/venv (not sure if this directory changes).

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

1 participant