py3grads icon indicating copy to clipboard operation
py3grads copied to clipboard

Installation did not work for me

Open JonAhlquist opened this issue 5 years ago • 3 comments

Background: I am running 64-bit Fedora 29 Linux on a Dell laptop. I installed Python 3 using Fedora's "dnf install". I am a meteorologist who mainly uses Fortran 90 with gfortram but I am also learning Python 3.

When I tried to install py3grads using the instructions at GitHub, I received a syntax error. Because I am a Python beginner, I do not know how to fix the error. In any case, the posted installation commands don't run under Fedora 29's Python 3. Here are installation commands and the system replies that I received. [BEGIN QUOTE] [root@localhost ahlquist]# git clone https://github.com/meridionaljet/py3grads Cloning into 'py3grads'... remote: Enumerating objects: 65, done. remote: Total 65 (delta 0), reused 0 (delta 0), pack-reused 65 Unpacking objects: 100% (65/65), done. [root@localhost ahlquist]# cd py3grads [root@localhost py3grads]# python setup.py install running install running build running build_py creating build creating build/lib creating build/lib/py3grads copying py3grads/init.py -> build/lib/py3grads copying py3grads/gacore.py -> build/lib/py3grads running install_lib creating /usr/lib/python2.7/site-packages/py3grads copying build/lib/py3grads/init.py -> /usr/lib/python2.7/site-packages/py3grads copying build/lib/py3grads/gacore.py -> /usr/lib/python2.7/site-packages/py3grads byte-compiling /usr/lib/python2.7/site-packages/py3grads/init.py to init.pyc byte-compiling /usr/lib/python2.7/site-packages/py3grads/gacore.py to gacore.pyc File "/usr/lib/python2.7/site-packages/py3grads/gacore.py", line 72 args = (executable, '-'+newflags, *opts) if newflags else (executable, *opts) ^ SyntaxError: invalid syntax

running install_egg_info Writing /usr/lib/python2.7/site-packages/py3grads-1.0-py2.7.egg-info [root@localhost py3grads]# [END QUOTE]

JonAhlquist avatar Apr 22 '19 04:04 JonAhlquist

From the output, it appears you are trying to install the package under Python 2.7, which is probably still the system default for the root user on Fedora 29. Ensure that when you type "python setup.py install" that the python executable being run is actually Python 3. You can type which python to check the executable's path. Python 3 may be installed on the path /usr/bin/python3, for example, and you may need to call that executable directly.

meridionaljet avatar Apr 22 '19 12:04 meridionaljet

From the output, it appears you are trying to install the package under Python 2.7, which is probably still the system default for the root user on Fedora 29. Ensure that when you type "python setup.py install" that the python executable being run is actually Python 3. You can type which python to check the executable's path. Python 3 may be installed on the path /usr/bin/python3, for example, and you may need to call that executable directly.

Hi, I am wondering whether we have setup.py for this right now. I don't see the setup.py in here. Thanks.

htan2013 avatar Jan 07 '24 22:01 htan2013

From the output, it appears you are trying to install the package under Python 2.7, which is probably still the system default for the root user on Fedora 29. Ensure that when you type "python setup.py install" that the python executable being run is actually Python 3. You can type which python to check the executable's path. Python 3 may be installed on the path /usr/bin/python3, for example, and you may need to call that executable directly.

Hi, I am wondering whether we have setup.py for this right now. I don't see the setup.py in here. Thanks.

This project now uses the standardized pyproject.toml, which supersedes the functionality of setup.py. The project can now be installed simply with pip install from inside the project directory or pip install git+https://github.com/meridionaljet/py3grads

meridionaljet avatar Jan 08 '24 16:01 meridionaljet