0
I work in a multi-user setting and am relatively new to Python. The machines in question run Ubuntu 16.04, and we are using Python 2.7. I personally have installed several additional modules, such as tensorflow, keras, and some other related modules and I believe I used the pip installer (pip 18.0 from /usr/local/lib/python2.7/) to install these (sudo pip install X
).
I've been successfully running python scripts for months using all of these modules but another user has been unable to run any python code that uses any of the modules that I've installed. Even a 1-line script that exists only to import a module such as:
import tensorflow
fails to run, generating an ImportError (I'll only paste the last couple of lines):
File "/usr/local/lib/python2.7/dist-
packages/tensorflow/python/ops/variable_scope.py", line 24, in <module>
import enum # pylint: disable=g-bad-import-order
ImportError: No module named enum
What did I do wrong that's making these modules invisible to other users, and how can I fix it?
where did you get that option
--system
? – co2f2e – 2019-11-20T23:45:41.620As mentionned in my answer,
pip install --help
– binarym – 2019-11-21T11:58:01.503https://pip.pypa.io/en/stable/reference/pip_install/#example-requirements-file please go through the documentation . No such option is available – co2f2e – 2019-11-21T19:23:08.827
You're right... Looks like my Debian implements a
pip
option that doesn't exist in uptstream. Maybe a Debian patch ? – binarym – 2019-11-21T20:35:23.317There never been such an option @binarym – co2f2e – 2019-11-21T20:36:39.883
@co2f2e see my edit. I fetched the source package for
python-pip
on Debian. The--system
is implemented by a patch that has probably been added by Debian maintainer. – binarym – 2019-11-21T20:40:21.943this is more of a hacky way to do it – co2f2e – 2019-11-21T20:51:21.013
Seeing the number of response in this question ... looks like it is the "only" way to do it ? ;-( – binarym – 2019-11-22T08:57:40.600
Negative, if you install any module like pip install dependency, without specifying a user it will available for all users – co2f2e – 2019-11-22T09:06:34.287
no such option: --system – Vasin Yuriy – 2020-02-12T08:21:02.387
Did you read comments ? – binarym – 2020-02-13T09:05:43.553