Python environment settings (virtualenv + pip cannot be done)

Hello it is what you are trying to produce the app in django in python beginner. (Development with python3 system) It seems that you can do it with anaconda + django, but since there is little information, I will challenge it later. First, check the difference between pyenv, virtualenv, pip, and anaconda. https://mycodingjp.blogspot.com/2018/12/python-venv-virtualenv.html https://oversleptabit.com/archives/2195 https://qiita.com/caad1229/items/325ca5c8ad198b0ebce7 I decided to go with virtualenv + pip. On the official website, I created a virtual environment with the venv command. I was able to do that, but I'll leave it for now. https://www.python.jp/install/macos/virtualenv.html

% python -V

Check the version of your own pc. I already had the 2nd system. Since the 2nd system is no longer supported, install the 3rd system. As a flow It should go to xcode → homebrew → python3. By the way, it seems that you need to install xcode to use homebrew. (Homebrew manages packages.)

% xcode-select --install

If you search the net for homebrew installation, the command will come out immediately

% /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
% brew install python3

Now we will finally create a virtual environment. First, install virtualenv

% sudo pip install virtualenv

Then

sudo: pip: command not found

When. No command? According to the net, there is a note that comes with installing python. .. Is there no pip?

% where pip
/usr/local/bin/pip

In my case, I thought it was a version issue, so I will update the version. To pip3. ..

% pip3 install --user --upgrade pip

If you can't use the pip command, you can get a hint by looking at this as well. https://www.python.jp/install/ubuntu/pip.html https://qiita.com/sf213471118/items/3ee4ebd5d39856345682 https://qiita.com/tom-u/items/134e2b8d4e11feea8e12

Try again

% sudo pip install virtualenv

I was able to go! !! !! !!

Looking at the official website, I wondered if there was a different method, but I will consider it again.

I'm glad I was able to go crispy after that.

% virtualenv -p python3 favorite name

Create a virtual environment by specifying python3. I will go inside the one I made

% . .Favorite name/bin/activate

Or

%source Favorite name/bin/activate

When exiting

% deactivate

It took a long time, but I was relieved. After making one app, I will try the official method. Please feel free to correct any mistakes.

Recommended Posts

Python environment settings (virtualenv + pip cannot be done)
python environment settings
"Temporary solution" when pip cannot be updated [Python]
Investigation when import cannot be done with python
Matplotlib etc. cannot be imported in VirtualEnv environment
Python note: When the pip command cannot be used
When import matplotlib.pyplot cannot be done in pyenv-virtualenv environment
Video cannot be loaded with Spyder in Python development environment
Build python virtual environment with virtualenv
Install Python on Windows + pip + virtualenv
Emacs settings for Python development environment
python + SCOOP distributed computing cannot be done on a Windows PC
Jupyter Notebook 6.0.2 cannot be installed in the Python 2.7 environment created in Anaconda
Competitive programming with python Local environment settings
Python modules with "-(hyphen)" cannot be removed
Measures that pip install cannot be done with pycharm or import ssl cannot be done
Clean python environment with pythonz and virtualenv
Build Python development environment (pythonz, virtualenv, direnv)
Solution when aws-cli cannot be executed on Mac virtual environment (after installing Python 3.8)
De-VBA Excel tool! Eliminate VBA tool with Python in environment where Python cannot be installed
Python3 TensorFlow environment construction (Mac and pyenv virtualenv)
Project cannot be created with Python3.5 (Windows) + django1.7.1
Building a python environment with virtualenv and direnv
Use the latest pip in a virtualenv environment
Manage Python multiple version environment with Pythonz, virtualenv
python development environment -use of pyenv and virtualenv-
What to do if pip cannot be installed
Commands for creating a python3 environment with virtualenv
Work in a virtual environment with Python virtualenv.
[Django3] Environment construction and various settings summary [Python3]
PIL cannot be installed by virtualenv with pyenv
Python environment construction
python windows environment
python environment construction
Python --Environment construction
Python environment construction
python in virtualenv
python environment construction
Japanese can be used with Python in Docker environment
Build a python virtual environment with virtualenv and virtualenvwrapper
Summary of python environment settings for myself [mac] [ubuntu]
[Memorandum] Japanese keys cannot be used in python string.Template.substitute
Causes when python version cannot be changed using pyenv
list comprehension because operator.methodcaller cannot be used in python 2.5
Operators ++,-cannot be used in python (difference from php)
Build a python virtual environment with virtualenv and virtualenvwrapper
python memo (for myself): About the development environment virtualenv
[Redash] Standard library cannot be used in python function
Problem that pip install cannot be done with pyenv + Yosemite (error: command'clang' failed with exit status 1)