madamow / pymoogi

python wrapper for MOOG. All plots are handled with matplotlib.
10 stars 4 forks source link

pymoogi using the wrong version of Python: install instructions #24

Closed adj-smith closed 1 year ago

adj-smith commented 1 year ago

I currently have both python2.7 and python3 installed on my machine (Ubuntu 22.04.2 jammy). I was able to install pymoogi successfully by following the instructions in the readme; however, I ran into syntax errors when running it. It turns out that while pymoogi uses python3 syntax, it does not explicitly force installation under python3. This can result in an apparently successful install, followed by syntax errors on execution if installed on the wrong version of python; e.g.

print(f'Your new factor is: {rfactor}')

is python3 syntax, and will crash if run in python2.

It might seem obvious, but for users with multiple python installations, the non-version-explicit python setupy.py install command (as used in the readme install instructions) could very easily call the wrong version of python, resulting in an accidental wrong-version install.

The solution on the user side, of course, is simple: when installing pymoogi, explicitly calling the correct version of python during setup will cause it to install correctly (python3 setup.py install). However, an update to the readme would help users (like myself) who have multiple python installs avoid this pitfall entirely.

madamow commented 1 year ago

Good point. I will correct the ReadMe file. Thanks!