Created a virtual environment on Ubuntu without using Anaconda.
Ubuntu18.04.05 LTS python:3.6.9
$sudo apt-get update
$sudo apt-get upgrade
$sudo reboot
$sudo apt install python3-venv
venv: Tools required to build a virtual environment. It seems that Python 3.3 or later is required.
#First, create a directory to create a virtual environment.
$mkdir test_env
$cd test_env
mkdir test_env
Move to the directory created by $ cd test_env
.
$python -m venv tensorflow
Create a directory for the virtual environment with the name "tensorflow".
The contents are
This completes the virtual environment.
$source test_env/tensorflow/bin/activate
Now it acts as a virtual environment.
I created a test_env
directory in my home for the virtual environment
Furthermore, it is long because it is created as tensorflow
under it.
If you created it in your home directory, put it in the environment with source tensorflow/bin/activate
.
In a virtual environment
(tensorflow)~@~$pip3 install numpy
(tensorflow)~@~$pip3 install tensorflow-gpu==1.14
(tensorflow)~@~$pip3 install matplotlob
All you have to do is install and so on.
However, only pip3 install opencv-python
throws an error and does not work.
It hurts to forget to copy the error
As a result, pip was old and spit out that it didn't have the required modules.
pip3 install -U pip
I typed this in and upgraded and it was OK.
After that
pip3 install opencv-python==3.4.11.45
I was able to install it by typing.
I specified the version because I was afraid of problems with the opencv4 system.
For the time being, I managed to get there.
In a virtual environment
(tensorflow)~@~$pip install ipykernel
#After install
(tensorflow)~@~$ipython kernel install --user --name=tensorflow
This will allow you to select the kernel in the jupyter notebook.
Well, I'm trying various things.
Recommended Posts