Reputation: 7827
my gitlab-ci.yml
I install python-pandas but I can't use it from python.
$ cat .gitlab-ci.yml
image: python:2
test:
script:
- apt-get update -qy
- apt-get install -y python-pip python-pandas
- ls /usr/local/lib/python2.7/site-packages
- python -c 'import pandas'
The runner failed with this message::
$ python -c 'import pandas'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named pandas
ERROR: Build failed: exit code 1
I try to not install pandas with pip as requirement (old pandas lib is enought) And very much would like to understand why python packages are not exposed ? this look like an implicit virtualenv !?
Upvotes: 8
Views: 18077
Reputation: 313
You should create a virtualvenv in before_script
:
before_script:
- apt-get -qq update && apt-get -qq install -y python
- apt-get -qq update
- apt-get -qq install -y python python-virtualenv python-pip
- virtualenv venv
- . venv/bin/activate
- python -V
- pip install pandas
Upvotes: 13