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

Ploomber fails to install a virtual environment on a system with py2 and py3 installed #435

Closed
mgierdal opened this issue Dec 9, 2021 · 7 comments

Comments

@mgierdal
Copy link

mgierdal commented Dec 9, 2021

After ploomber install I got this:

/usr/bin/python: No module named venv
Error: An error occurred when executing command: python -m venv venv-chq
Original error message: Command '('python', '-m', 'venv', 'venv-chq')' returned non-zero exit status 1.

It looks like ploomber calls plain python, which on my system defaults to py2 that doesn't have venv.
My system is CentOS with py2.7.5 (python) and py3.7.6 (python3)

I wonder if py2 interferes only with creation of a virtual environment, which can be remedied manually, or there are more surprises ahead.

Thanks,
Marcin

@edublancas
Copy link
Contributor

edublancas commented Dec 11, 2021

Hi, thanks for reporting. I didn't anticipate this but you're right, some systems have python configured to Python 2.

Did you find a workaround? You could create the venv directly by calling python3 -m venv and then use pip install while we fix this.

@mgierdal
Copy link
Author

mgierdal commented Dec 13, 2021

  1. I put an alias alias python=python3 into .bashrc, which unfortunately doesn't get used when cmdr.run('python', '-m', 'venv', venv_dir, description='Creating venv') from install.py gets executed.

  2. Then I resorted to python3 -m venv venv-lyme1 from within lyme1 directory and got this error:
    Error: [Errno 95] Operation not supported: 'lib' -> '/......../final_data_review/lyme1/venv-lyme1/lib64'.
    This, however, has something to do with the location being ona cifs mounted network drive (to which I have full -wxr- rights), as I am able to create the same venv in a level just above the mount point.

There seems to be 2 issues going on here: 1) related to ploomber (install.py not using an alias), and 2) rather unrelated to it (most probably the same as mlsecproject/combine#173 (comment)).

@edublancas
Copy link
Contributor

  1. AFAIK, aliases are not available to sub-processes. So this is something we have to fix (I'm thinking Ploomber should try python and then python3 - we'll work on that
  2. That sounds like a filesystem problem

We'll take of 1. but may take a bit. So looks like the short-term solution is to create the venv in a folder where you don't get the permission issue.

@edublancas
Copy link
Contributor

Hi, let me know if you were able to fix the filesystem error

@idomic
Copy link
Contributor

idomic commented Jan 27, 2022

@arturomf94 This one should be a rather quick fix

edublancas added a commit that referenced this issue Feb 5, 2022
@edublancas
Copy link
Contributor

hey @mgierdal, we fixed this. it will be part of the next release (coming out next week) - please let us know if this solves your problem

edublancas added a commit that referenced this issue Feb 6, 2022
edublancas added a commit that referenced this issue Feb 11, 2022
@edublancas
Copy link
Contributor

this has been fixed and released it, so closing this. feel free to re-open it if you still have problems

edublancas added a commit that referenced this issue Feb 14, 2022
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