所以我有一个新的debian安装。我安装了pythons 3.5、3.6、3.7:
root@m2:~# apt-get install python3.{5,6,7}-dev
并尝试设置一些虚拟环境:
for i in 5 6 7 ; do dir=venv3.$i; echo $dir; mkdir $dir; virtualenv $dir --python=python3.$i; done
结果:
-------------
venv3.5
Running virtualenv with interpreter /usr/bin/python3.5
Using base prefix
例如,我得到了这个错误:
global name 'Poll' is not defined
Exception Location: /var/www/pythonRoot/scrapfull/pollsresponse = callback(request, *callback_args, **callback_kwargs)
File "/var/www/pythonRoot/scrapfull/polls
以下是相关代码片段:
@contextlib.contextmanager
def make_temp_dir():
temp_dir = tempfile.mkdtemp()
yield temp_dir
shutil.rmtree(temp_dir)
with make_temp_dir(listing_id) as tmpdir:
pass
# Sometimes something in here throws an exception that gets caught higher up
好吧,把这