Configuring python for coppelia in ubuntu 24.04

Typically: "How do I... ", "How can I... " questions
Post Reply
tttbarros
Posts: 2
Joined: 25 Oct 2023, 19:08

Configuring python for coppelia in ubuntu 24.04

Post by tttbarros »

Hi! I was researching how to configure python inside coppelia in ubuntu 24.04. I've already configured it in windows, by setting python in the file usrset.txt located at C:\Users\user\AppData\Roaming\CoppeliaSim and installing zmq and cbor libraries.

How can i do that procedure for ubuntu?

Thanks in advance
coppelia
Site Admin
Posts: 10747
Joined: 14 Dec 2012, 00:25

Re: Configuring python for coppelia in ubuntu 24.04

Post by coppelia »

Hello,

on Ubuntu 24, Python is safeguarded to prevent users from causing system-wide damage. To manage Python-related tasks and specific packages without risking the system's integrity, it is recommended to use a virtual environment, which isolates dependencies and configurations for individual projects. You could do something like following, using venv:

Code: Select all

sudo apt install python3-pip
sudo apt install python3.12-venv
python3 -m venv myConfiguration
source myConfiguration/bin/activate
You'll have to make sure to always first source myConfiguration as the first instruction in a new terminal, to make sure the virtual environment is activated. Then you can use Python as previously, e.g. installing new packages, etc, e.g.:

Code: Select all

pip3 install pyzmq
pip3 install cbor2
And you should not need to modify anything in usrset.txt in that case.

Cheers
Post Reply