CS-Lab Support Forum for CNC Community

Help to run this brand-new forum and stay with us.
Ask your questions, we are here to help! 

 

Forum Navigation
You need to log in to create posts and topics.

install pyserial

Hello CNC friends

I would like to send data in a Python script over a serial port
To do this I have to do “serial import”, but unfortunately I get an error that this module cannot be found.
In the normal Python installation on Windows it works.
How can I do “pip install pyserial” in simcnc?

Hi,
simCNC uses a "normal" Python!
If you have several Python versions on your PC, then you must check which one is set for simCNC. You will find the path under your simCNC installation folder (e.g. C:\Program Files\simCNC\python) in the file pythonInstallationPath.
You can look at the pythonInstallationPath file with a normal text editor, e.g. Notepad, and it will say something like C:\Users\boess\AppData\Local\Programs\Python\Python310\python.exe.
You can change the path if you want to use a different (i.e. usually newer) version or you can go to the scripts directory and take the pip from that folder. For me it would be this folder: C:\Users\boess\AppData\Local\Programs\Python\Python310\Scripts

VG
Anton

CS-Lab Support has reacted to this post.
CS-Lab Support

I will just add two things:

If the pip installer does not work, it should be reinstalled by modifying the Python installer:

 

 

- As a place to install the libraries, I recommend a permanent place independent of simCNC.
I install the libraries in the Python home folder C:\Users\wojtek\AppData\Local\Programs\Python\Python311

If you have only one version of python installed (by simCNC installer), typing 'py -m pip install ...' will use same python as simCNC, so you can install packages from terminal and use then later in the simCNC scripts. 
Eventually you can type 'py -3.11 -m pip install ...' this will explicitly call python 3.11 which is used by recent version of simCNC.

PARTNERS:

 

USA

Germany

Slovenia / Bosnia

Spain

South Africa

UNI-CAM

The Netherlands

Portugal

Greece

  Distrib milionis logo

Hungary

Distrib logot

Bulgaria

Master

Kenya

Proteq Automation

Egypt

Germanelectronix

China

Jun Ma

Serbia

ALCO

Italy

LVL tech r

Denmark

Varntoft Dania

Finland