T
T
Timebird2019-07-11 16:16:12
Python
Timebird, 2019-07-11 16:16:12

How to write PYTHONPATH correctly?

Hello.
I installed the package from the sources, everything is OK:

...
Installed /usr/local/lib/python3.5/dist-packages/keras_segmentation-0.2.0-py3.5.egg
Processing dependencies for keras-segmentation==0.2.0
Finished processing dependencies for keras-segmentation==0.2.0
(base) [email protected]:~/image-segmentation-keras$ python3
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras_segmentation
Using TensorFlow backend.
>>> exit()

Closed the terminal. Opened:
(base) [email protected]:~$ python3
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras_segmentation
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'keras_segmentation'
>>>

Can you please tell me what could be causing this?
The path to the python is the usual:
>>> import sys
>>> sys.executable
'/home/user/anaconda3/bin/python3'

upd: the command helped:
(base) [email protected]:~$ sudo env "PATH=$PATH" python3 setup.py install

And how not to write env "PATH=$PATH" every time, why do you have to write this at all and where can you read about it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Radjah, 2019-07-11
@Radjah

> lib/python3.5
> Python 3.7.3
Doesn't the difference in versions bother you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question