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

Error: Failed to create Python 3 venv #43

Closed
kidkill opened this issue Jul 5, 2021 · 6 comments
Closed

Error: Failed to create Python 3 venv #43

kidkill opened this issue Jul 5, 2021 · 6 comments

Comments

@kidkill
Copy link

kidkill commented Jul 5, 2021

Could not create new venv Cleaning up...
Fatal Error: Exiting

Script output
Please paste the complete output of the script in the box below:

OctoPrint Upgrade to Py 3 (v2.1.15)                                                                                                                                                                                                                 
Hello!                                                                                                                    
This script will move your existing OctoPrint configuration from Python 2 to Python 3                                     
This script requires an internet connection and it will disrupt any ongoing print jobs.                                                                                                                                                             
It will install the latest version of OctoPrint and all plugins.                                                          
No configuration or other files will be overwritten                                                                                                                                                                                                 
Press [enter] to continue or ctrl-c to quit                                                                                                                                                                                                         
Detecting system info...                                                                                                  
OctoPi version: 0.17.0                                                                                                    
Getting OctoPrint version...                                                                                              
OctoPrint version: 1.6.1                                                                                                  
Reading installed plugins...                                                                                                                                                                                                                        
Plugins installed                                                                                                         
- Filament Sensor Reloaded                                                                                                
- OctoPrint-IFTTT                                                                                                         
- Filament Scale                                                                                                          
- Enclosure Plugin                                                                                                       
- GPIO Shutdown                                                                                                           
If you think there is something missing from here, please check the list of plugins in Octoprint                          
Press [enter] to continue or ctrl-c to quit                                                                                                                                                                                                         
Checking package list for python3-dev                                                                                     
python3-dev not installed, proceeding to install                                                                          
Root access is required to install python3-dev, please fill in the password prompt if shown                               
Updating package list...                                                                                                  
[sudo] password for pi:                                                                                                   
Installing python3-dev...                                                                                                 
Successfully installed python3-dev                                                                                        
Creating new Python 3 environment...                                                                                      
ERROR: Failed to create Python 3 venv                                                                                     
Could not create new venv                                                                                                                                                                                                                           
Cleaning up...                                                                                                            
Fatal Error: Exiting                                                                                                      
pi@octopi:~ $

Script version
You can find this printed in the first line of the script

OctoPrint Version
OctoPrint 1.().()

Relevant plugins that may have caused errors
If you're having trouble with a particular part, please include your installed plugins

Additional information
Screenshots, links to docs, etc.

@cp2004
Copy link
Owner

cp2004 commented Jul 5, 2021

Could you try running python3 -m venv test-venv and report the results?

@ElDavoo
Copy link

ElDavoo commented Jul 5, 2021

Creating new Python 3 environment...
The virtual environment was not created successfully because ensurepip is not

available. On Debian/Ubuntu systems, you need to install the python3-venv

package using the following command.

apt-get install python3-venv

You may need to use sudo with that command. After installing the python3-venv

package, recreate your virtual environment.

Failing command: ['/home/pi/oprint/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']


Soooooooooooo you need to install python3-venv and it will work.

I'm using latest octoprint and octopi 0.17.0.

Documentation should be updated.

@cp2004
Copy link
Owner

cp2004 commented Jul 5, 2021

This was a recent change - #42 - I will revert it, the previous one worked on more systems apparently.

A smarter handling of the failures that made me want to switch it is probably smart.

@cp2004
Copy link
Owner

cp2004 commented Jul 5, 2021

Thanks for reporting the error @ElDavoo - I have reverted the changes. It may take a short while for caching to expire, the new script version is 2.1.16. Just in case you felt like using it again.

@cp2004 cp2004 closed this as completed Jul 5, 2021
@ElDavoo
Copy link

ElDavoo commented Jul 5, 2021

It's still installing plugins right now because of #44 :)

@discojon
Copy link

discojon commented Oct 13, 2021

I'm seeing this same issue today with the script. The output of

python3 -m venv test-venv

is

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/pi/test-venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

Following that I run

sudo apt install python3-venv

and get

Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-venv is already the newest version (3.7.3-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

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

4 participants