很好的文档
编译过程中问题:
下面参照
sudo apt-get -y upgrade
The -y flag will confirm that we are agreeing for all items to be installed, but depending on your version of Linux, you may need to confirm additional prompts as your system updates and upgrades.
不知道为什么不自带pip
sudo apt-get install -y python3-pip
There are a few more packages and development tools to install to ensure that we have a robust set-up for our programming environment:
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
Once Python is set up, and pip and other tools are installed, we can set up a virtual environment for our development projects.
pip依附与特定版本的python么?
怎么看依附与哪个版本?
sudo apt-get install -y python3-venv
mkdir environments
cd environments
失败
python3 -m venv my_env
#Error: Command '['/home/tshogx/python3.7_environments/try_env_1/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
source my_env/bin/activate
#bash: source: try_env_1/bin/python3: cannot execute binary file
修改为 成功
python3.5 -m venv my_env
source my_env/bin/activate
(my_env) tshogx@tshogx-Ubuntu:~$
Note: Within the virtual environment, you can use the command python instead of python3, and pip instead of pip3 if you would prefer. If you use Python 3 on your machine outside of an environment, you will need to use the python3 and pip3 commands exclusively.
尝试理解该环境
尝试在该环境运行,配合ipython,代替pycharm
pipenv?
此时venv默认python3.5
如何改成3.7?
ipython
sudo pip3 install ipython
黄字
# The directory '/home/tshogx/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
# The directory '/home/tshogx/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
下载jupyter
pip3 install jupyter
失败
command -v pip3
# 找到pip3路径
sudo [路径] install jupyter
# 成功
1
1