Python 3.4 does not recognize package

On my raspberry pi 3 model B, I run linux raspberrypi 4.4.48-v7, which is a debian distribution / flavor.

I installed python 3.4.

sudo pip install enum34

returns -

Requirement already satisfied: enum34 in /usr/local/lib/python3.4/dist-packages.

I am trying to install and run this open source project to interact with bluetooth for microbots (but I believe my problem is with python configuration) -

https://github.com/VRGhost/PyPush

I installed the package and requirements, but when I try to download / maintain the package as follows -

./bin/serve.sh --ble_driver bluegiga --ble_device /dev/tty.usbmodem1 web_ui

I get -

/usr/bin/python: No module named enum; 'PyPush' is a package and cannot be directly executed

I believe the line in serve.sh that fails is

exec python -m PyPush $*

How can I make python recognize PyPush as a module? The material I found online refers to the enum34 that is installed.

+4
4

enum34 , Python 3.4. Python 3.4 enum Python. import enum Python 3.4 +.

, Python. : Python 2.7 Python 3.x. . , .

pip install enum34, Python, pip --version, . python --version which python , , .

Python, , , , , pip, /usr/local/bin/. , /usr/local/bin/pip3.4 /usr/local/bin/pip3 /usr/local/bin/python3.4 /usr/local/bin/python.

, , Python. , , Python apt Python .

, , Raspbian - Debian, . Debian Python 3 Python 2. /usr. , Python - , 3.4, /usr/local.

, Linux , . Debians apt. , , , script, .tar.gz, , . Debian apt search, , , , , (, Python, Node, Yarn) .

, , , pip enum34. , Python 2.7. , pip --version. Python 3.5, :

$ pip --version pip 9.0.1 from /usr/local/lib/python3.5/site-packages (python 3.5) $

, Python 3 ​​ /usr/local/, , macOS, Python 3 . Debian Python apt, /usr/.

, pip install enum34, Python, pip --version, . , python --version, python. , ​​ Python, , . which pip which python, . which pip /usr/local/bin/pip which python /usr/bin/python, .

, , , , , . Python , , . , pip python. , , virtualenv.

+4

, . .

  • , python /usr/local/lib/python3.4/dist-packages libs. , import sys;print (sys.path), , python . , .
  • , python python2.7 python3 python python2.7. , Python 2.7 python 3 python .
  • pip python2, pip3 python3. , pip , , 1.
  • , , (: , root), , shell, . .

, 4 , . , 1 4.

+3

- , Python .

Python - Python 2 Python 3. python executable (/usr/bin/python) Python 2 pip Python 2. Python 3 python3 pip3 .

pip ( Python2) , /usr/local/lib/ python3.4 /dist-packages. .

, , . env, , :

virtualenv --always-copy --python=python2 /path/to/virtualenv/directory
source activate /path/to/virtualenv/directory
pip install -r requirements/prod.txt
./bin/serve.sh --ble_driver bluegiga --ble_device /dev/tty.usbmodem1 web_ui

virtualenv,

apt install virtualenv
+1

pip Python 2.x, pip3 Python 3.x. , Python PyPush. print . GitHub print ... print(...), , , Python 2.x, Python 3.x. 2.x.

Requirement already satisfied: enum34 in /usr/local/lib/python3.4/dist-packages.

, enum Python 3.x,

/usr/bin/python: No module named enum; 'PyPush' is a package and cannot be directly executed

/usr/bin/pythonon most distributions it still stands for Python 2.x. You can check which version (2.x or 3.x) s /usr/bin/python --versionto make sure.

Long, short speech - you have a package enumfor Python 3.x, PyPush is written for Python 2.x, and you also need backported enumfor Python 2.x.

+1
source

Source: https://habr.com/ru/post/1675723/


All Articles