Closed karussell closed 6 years ago
Could you explain how one needs to install python3 with virtualenvs?
Well, you need to install python 3 on your system, along python 2.7 if you have it. The virtualenv is for installing python package out of your system.
Which OS are you running?
My problem is that it is an 16.04 Ubuntu with python 2.7 and so some tools from apt rely on python 2.7 and I did not find a way to use python3 on my system without deinstalling 2.7.
Humm, isn't Ubuntu 16.04 shipped with both Python 3 and Python 2 pre-installed? What do you have if you type python3
on your terminal?
Ah, ok. This works ... so how do I pick the correct python when executing .py files :) ?
(And what about the pip requirements?)
Ah, ok. This works ... so how do I pick the correct python when executing .py files :) ?
This is how I'd do it on a fresh Ubuntu server:
# You can store the venv where ever you want
python3 -m venv path/of/your/choice
# each time you want to activate the virtualenv
source path/of/your/choice/bin/activate
# Once the venv is active, install dependencies
pip install -r path/to/geocoder-tester/requirements.txt
# And then
py.test -h
You may use higher level tools (like mkvirtualenv or pyenv) but that recipe is simple enough for baby steps imho.
Thanks, this worked. How do I run all tests?
py.test --api-url 'http://photon.komoot.de/api?'
==================== test session starts ====================
platform linux -- Python 3.5.2, pytest-3.2.3, py-1.4.34, pluggy-0.4.0 -- /path/to../.python-venv/bin/python3
cachedir: .cache
rootdir: /path../geocoder-tester, inifile: pytest.ini
collected 0 items
=================== no tests ran in 0.01 seconds =============
You need to run py.test from the root for geocoder-tester, is it the case?
Sorry, I messed up the repo when I tried the python3 stuff. Now this works.
Could you explain how one needs to install python3 with virtualenvs? I fear I messed something up as I currently get: