CodeMan

Each of us must find a way to love the world. You have found yours.

0%

Python virtualenv

Install && Basic Usage

1
2
3
4
5
6
7
➜ ~ pip3 install virtualenv
➜ ~ mkdir project
➜ ~ cd project
➜ project virtualenv --no-site-package venv
➜ project source venv/bin/activate
(venv) ➜ project python --version

指定python版本

2.7:

1
2
virtualenv --no-site-package ----python=python2.7 venv 

3.7:

1
2
virtualenv --no-site-package ----python=python3.7 venv 

退出使用环境

(venv) ➜ project deactivate

开启代理后报错

Could not install packages due to an EnvironmentError: Missing dependencies for SOCKS support.

由于不支持sockt5,则改为http代理即可

1
2
3
unproxy
export all_proxy=https://127.0.0.1:1087

让pip使用HTTP代理

1
2
3
pip --proxy 127.0.0.1:1087 install xxx
pip --proxy 127.0.0.1:1087 install PyPDF2

Proejct Interpreter->(弹出菜单中右上角图标Add)Add…
Virtualenv Enviroment -> Existing enviroment->选择自己项目目录下venv/bin/python

tradove-v2.5-nginx:
image: 119.84.60.71:5050/release/v2.5/nginx1.15.8:release
ports:
- “${WEB_PORT}:80”
- “443:443”
depends_on:
- tradove-v2.5-php-fpm
links:
- tradove-v2.5-php-fpm:php
volumes:
- ${PROJECT_BASE_DIR}:/var/www
- ${PROJECT_BASE_DIR}/docker/nginx/certificate_dev:/etc/nginx/certificate #测试服务器可用
- ${PROJECT_BASE_DIR}/docker/nginx/conf.d:/etc/nginx/conf.d:rw
restart: always
container_name: “tradove-v2.5-nginx”
privileged: true
networks:
- tradove-net