tutorial
tutorial copied to clipboard
Cloud9 venv issues
Continuing in Cloud9 from Issue #825
Even though that seemed to work (doing the update before installing python-venv), I could not create the myvenv virtual environment. The error is the same as the first note under the Linux and OSX at http://tutorial.djangogirls.org/en/installation/#linux-and-os-x
But, I got an error at the install of python3-venv:
$ sudo apt-get install python3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-venv
So I did the next options:
$ sudo apt-get install python-virtualenv
$ virtualenv --python=python3.5 myvenv
This seems to have worked.
In a separate Cloud9 workspace, when I skipped all that above and ran python3.5 -m venv myvenv to create the virtualenv, it appears that it created it correctly.
They both seem to activate OK and work correctly. Does anyone have any idea if one method is preferable?
If it doesn't matter, then perhaps we could just tell people to create the venv with python3.5 -m venv myvenv, since it seems to always work? (at least on Cloud9)
I will try to put some more comments in there to make this more clear. Heh.
OK, I think I've answered that question. In the Cloud9 workspace where I created the virtualenv using python-virtualenv, I get this error when trying to install Django:
$ pip install django~=1.9.0
Exception:
Traceback (most recent call last):
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/commands/install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/_vendor/pkg_resources.py", line 2606, in parse
reqs = list(parse_requirements(s))
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/_vendor/pkg_resources.py", line 2544, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/home/ubuntu/workspace/djangogirls/myvenv/lib/python3.5/site-packages/pip/_vendor/pkg_resources.py", line 2512, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'django~=1.9.0', 'at', '~=1.9.0')
However, after this, I did pip install --upgrade pip (not sure I needed that, but the other cloud9 workspaces told me I did) and then pip install -U pip setuptools (which I got from another hack originally for windows). Then when I did pip install django~=1.9.0, it appears that it is working. Go figure.
Hi @purplediane Thanks a lot for your help! :sparkles: Can you do a PR to fix the Cloud9 instructions?