[Python] Error and solution memo when using venv with pyenv + anaconda

environment

ubuntu 16.04 Python 3.5.2 pyenv 1.0.6 anaconda 1.5.1

Errors that occur

$ mkdir hoge
$ pyvenv hoge
Error: Command '['/some/directories/bin/python3.4', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

Solution

Quoted from askubuntu

$ mkdir hoge
$ pyvenv-3.5 --without-pip hoge
$ source venvdir/bin/activate
$ curl https://bootstrap.pypa.io/get-pip.py | python
$ deactivate
$ source venvdir/bin/activate

ubuntuask http://askubuntu.com/questions/488529/pyvenv-3-4-error-returned-non-zero-exit-status-1

Actually the second line

pyven-(python version) --without-pip (directory)

It seems that no error will occur if you use

Summary

I'm new to programming so I don't know why I get this error. According to askubuntu, it is broken, but ... Recently, program beginners saw in Environment construction is a big wall. I think this article is also a wall that beginners will hit like a beginner. For those who want to take off their skin and teach me for beginners, or if you want to teach me a site with explanations, I would appreciate it if you could comment and tell me on twitter.

Addition / correction

Thank you for your comment.

In Python3.5 or later, it seems to be done like python3 -m venv some_venv. The reason seems to be to clarify which version `` `venv``` is used when using environment management software. I see··· For details, refer to the citation source

Source https://jptomo.github.io/blog/2016/01310_not_use_pyvenv_but_venv.html

Recommended Posts

[Python] Error and solution memo when using venv with pyenv + anaconda
python with pyenv and venv
Error and solution when installing python3 with homebrew on mac (catalina 10.15)
Error when playing with python
Error when executing Python commands without using Anaconda Prompt
Minimum memo when using Python on Mac (pyenv edition)
When using MeCab with virtualenv python
Precautions when using six with Python 2.5
# Solution when pip install gives an error when using Anaconda on Windows 10
Using Python and MeCab with Azure Databricks
A memo with Python2.7 and Python3 on CentOS
I'm using tox and Python 3.3 with Travis-CI
How to deal with OAuth2 error when using Google APIs from Python
Precautions and error handling when calling .NET DLL from python using pythonnet
pyenv + anaconda + python3
Error when installing a module with Python pip
Building an Anaconda environment for Python with pyenv
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
[Memo] Build a virtual environment with Pyenv + anaconda
A memo when creating a python environment with miniconda
Build a virtual environment with pyenv and venv
Reading and writing fits files with Python (memo)
What are you using when testing with Python?
Three things I was addicted to when using Python and MySQL with Docker
What to do if you get an error when installing python with pyenv
Error that occurred in OpenCV3 and its solution Precautions when using OpenCV3 on Mac
[Note] Anaconda & VScode has trouble with python import error
What to do if you get an OpenSSL error when installing Python 2 with pyenv
Investigate the cause when an error is thrown when python3.8 is not found when using lambda-uploader with python3.8
Findings when accelerating numerical calculations with Python and Numba
Error due to conflict between python when using gurobi
Installation method when using RealSense from Python (pyenv edition)
Causes when python version cannot be changed using pyenv
Use Python 3.8 with Anaconda
Troublesome story when using Python3 with VScode on ubuntu
Install the latest stable Python with pyenv (both 2 and 3)
Install python with pyenv
Python3, venv and Ansible
I got an error when using Tensorboard with Pytorch
I get an error when I try to raise Python to 3 series using pyenv on Catalina
Error and solution when trying to run a classifier made with Labellio with my own ubuntu
Solution when you want to use cv_bridge with python3 (virtualenv)
I got a Value Error when using JUMAN ++ with PyKNP
Solution when the image cannot be displayed with tkinter [python]
A memo when face is detected with Python + OpenCV quickly
IP spoof using tor on macOS and check with python
A memo when creating a directed graph using Graphviz in Python
Using Python with SPSS Modeler extension nodes ① Setup and visualization
Serial communication control with python and I2C communication (using USBGPIO8 device)
Things to keep in mind when using Python with AtCoder
Notes on deploying pyenv with Homebrew and managing Python versions
Things to keep in mind when using cgi with python.
List of libraries to install when installing Python using Pyenv
Serial communication control with python and SPI communication (using USBGPIO8 device)
This and that for using Step Functions with CDK + Python
Programming with Python and Tkinter
When using optparse with iPython
Python 2 series and 3 series (Anaconda edition)
[CentOS7] Install anaconda using pyenv
Python and hardware-Using RS232C with Python-
[S3] CRUD with S3 using Python [Python]