Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import module with pip on raspberry pi 4 #10940

Closed
1 task done
IGDT opened this issue Mar 3, 2022 · 1 comment
Closed
1 task done

Cannot import module with pip on raspberry pi 4 #10940

IGDT opened this issue Mar 3, 2022 · 1 comment
Labels
type: support User Support

Comments

@IGDT
Copy link

IGDT commented Mar 3, 2022

Description

On my raspberry pi 4 I tried to code some basic stuff (like printing messages) to test out the pymodbustcp.
For some reason, it doesn't want to find the module of pymodbustcp and it gives this message below when I run the code. I think it has to do with pip but I am not sure
/home/pi/Desktop/Laadpunt/venv/bin/python /home/pi/Desktop/Laadpunt/main.py Traceback (most recent call last): File "/home/pi/Desktop/Laadpunt/main.py", line 7, in <module> from pyModbusTCP.client import ModbusClient ModuleNotFoundError: No module named 'pyModbusTCP' Process finished with exit code 1

I installed both "sudo pip2 install pyModbusTCP" as "sudo pip3 install pyModbusTCP" in my console and that says:

pi@raspberrypi:~ $ sudo pip install pyModbusTCP Traceback (most recent call last): File "/usr/local/bin/pip", line 6, in <module> from pip._internal.cli.main import main ModuleNotFoundError: No module named 'pip._internal.cli.main' pi@raspberrypi:~ $
What can I do to fix this issue? #5599 did not help me, if you need any info from commands tell me which ones.

Expected behavior

No response

pip version

pip 22.0.3 from /home/pi/.local/lib/python3.7/site-packages/pip (python 3.7)

Python version

pip 22.0.3 from /home/pi/.local/lib/python3.7/site-packages/pip (python 3.7)

OS

Raspberry pi 4 (linux)

How to Reproduce

putting this code in pycharm:
`
from pyModbusTCP.client import ModbusClient

try:
c = ModbusClient(host='10.0.0.182', port=502)
except ValueError:
print("Error with host or port params")
`
won't import pymodbustcp and yes I imported it using pip in my console

Output

/home/pi/Desktop/Laadpunt/venv/bin/python /home/pi/Desktop/Laadpunt/main.py
Traceback (most recent call last):
  File "/home/pi/Desktop/Laadpunt/main.py", line 7, in <module>
    from pyModbusTCP.client import ModbusClient
ModuleNotFoundError: No module named 'pyModbusTCP'
Process finished with exit code 1

Code of Conduct

@IGDT IGDT added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 3, 2022
@uranusjr
Copy link
Member

uranusjr commented Mar 3, 2022

Please find general help on forums such as StackOverflow, Discord, and mailing lists (python.org has a page for where to find communities).

@uranusjr uranusjr closed this as completed Mar 3, 2022
@uranusjr uranusjr added type: support User Support and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Mar 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: support User Support
Projects
None yet
Development

No branches or pull requests

2 participants