Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing serial
#1
I have a Python project I have been developing on Windows. (I wish I could use Linux for this project, because I would already be done)
My project has all its internals finished, now I have to populate the stubs for communicating with external hardware.
I have been reading tutorials about how to install pyserial on my Windows based python3. None of the tutorials instructions have worked.
I even resorted to asking ChatGPT for assistance. He/she struck out and finally told me to go to the forums for help. (So here I am)

I have a simple interface I must finish up. The only piece that is missing is that I cannot resolve the references to the serial module.
I know that pyserial is already present in my system, because I got this error message from one of my attempts:

$> pip install pyserial
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyserial in c:\users\docru\appdata\roaming\python\python310\site-packages (3.5)

And version 3.5 is the latest version.

But I have no idea how to get my python interpreter to access it. My PATH environment variable is set up to access python3, but "import serial" gives me this error: "ModuleNotFoundError: No module named 'serial' "

Does anyone out there have any suggestions?

Thanks,
Frank
Reply
#2
you may have multiple versons of python installed.
It's important to note thate each version would have it's own version of pip.
to see if the default version of each match, us(from command line)
python -V and pip -V
which python which I think is where python on windows

make sure all match
Reply
#3
The tutorials you need to watch are tutorials for creating Python virtual environments. You should create a virtual environment (venv) and install modules in this environment. This lets you have multiple Python projects without having to worry about one project having python or package versions that are incompatible with other projects.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 6,030 Aug-24-2023, 07:56 AM
Last Post: gowb0w

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020