I just freshly installed pythonpy. However, the package gives SyntaxWarnings during installation:
$ sudo apt install pythonpy
[sudo] password for melvio:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
pythonpy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.2 kB of archives.
After this operation, 49.2 kB of additional disk space will be used.
Get:1 http://nl.archive.ubuntu.com/ubuntu noble/universe amd64 pythonpy all 0.4.11b-3.1 [10.2 kB]
Fetched 10.2 kB in 0s (223 kB/s)
Selecting previously unselected package pythonpy.
(Reading database ... 187227 files and directories currently installed.)
Preparing to unpack .../pythonpy_0.4.11b-3.1_all.deb ...
Unpacking pythonpy (0.4.11b-3.1) ...
Setting up pythonpy (0.4.11b-3.1) ...
/usr/share/pythonpy/pythonpy/__main__.py:29: SyntaxWarning: invalid escape sequence '\.'
if re.match('np(\..*)?$', raw_module_name):
/usr/share/pythonpy/pythonpy/__main__.py:31: SyntaxWarning: invalid escape sequence '\.'
elif re.match('pd(\..*)?$', raw_module_name):
/usr/share/pythonpy/pythonpy/pycompleter.py:31: SyntaxWarning: invalid escape sequence '\.'
regex = re.compile("([a-zA-Z_][a-zA-Z0-9_]*)\.?")
/usr/share/pythonpy/pythonpy/pycompleter.py:34: SyntaxWarning: invalid escape sequence '\.'
if re.match('np(\..*)?$', raw_module_name):
/usr/share/pythonpy/pythonpy/pycompleter.py:36: SyntaxWarning: invalid escape sequence '\.'
elif re.match('pd(\..*)?$', raw_module_name):
Processing triggers for man-db (2.12.0-4build2) ...
And every command I run also gives syntax warnings:
$ py --version
/usr/bin/py:29: SyntaxWarning: invalid escape sequence '\.'
if re.match('np(\..*)?$', raw_module_name):
/usr/bin/py:31: SyntaxWarning: invalid escape sequence '\.'
elif re.match('pd(\..*)?$', raw_module_name):
Pythonpy ???
Python 3.12.3
Could this be something with my system's configuration, or is this a pythonpy issue?
1 Answer 1
The Ubuntu version of pythonpy seems to be out of date, and the original repo hasn't existed since around 2019. The most recently maintained version I could find is pythonpy-fork, though I cannot vouch for its contents.
The package is hosted on PyPI, not the Ubuntu Package archive, so you can install it with pip:
pip install pythonpy-fork
Once it's installed, you should be able to use it the same way you'd use the original package:
$ py "1 + 1"
2