SUAVE icon indicating copy to clipboard operation
SUAVE copied to clipboard

Installation fails with pipenv

Open danieljuschus opened this issue 4 years ago • 5 comments

I tried installing SUAVE to a virtual environment using pipenv (in Linux) with the command pipenv install ~/opt/SUAVE-2.2.0/trunk. This returns the following error:

Traceback (most recent call last):', '      File "<string>", line 1, in <module>', '      
File "/tmp/pip-req-build-6m60k6i5/setup.py", line 205, in <module>', '        main()', '     
File "/tmp/pip-req-build-6m60k6i5/setup.py", line 30, in main', '        install(the_package,version,date)', '      
File "/tmp/pip-req-build-6m60k6i5/setup.py", line 67, in install', "        long_description = read('../README.md')", '      
File "/tmp/pip-req-build-6m60k6i5/setup.py", line 197, in read', "        with open(path, 'r') as f:", "    FileNotFoundError: [Errno 2] No such file or directory: '../README.md'", '    ----------------------------------------', 'ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.'

Removing long_description from setup.py solves this but is obviously not an appropriate solution. Or am I doing something wrong?

danieljuschus avatar Aug 24 '20 13:08 danieljuschus

You have to do python setup.py install. Then maybe you have to install some other packages in python, like scipy, with pip install --user scipy. It will tell you what packages you have to install manually, then you run the first command.

jcrcx avatar Oct 05 '20 02:10 jcrcx

I know that that's the "standard way" to install SUAVE, but I'm wondering why it was done like this. Most people that I know prefer to use packaging tools such as pipenv, also to ensure compatibility in projects with many other packages. It seems though like it wouldn't be to hard to enable. To be honest, I also haven't looked into it in detail myself.

danieljuschus avatar Oct 05 '20 08:10 danieljuschus

This problem is because the setup.py assumes there is README.md in SUAVE/ not in SUAVE/trunk/.

Lots of suave code depends on propeller_design function, which assumes there is SUAVE/regression/scripts/Vehicles/NACA4412.txt and other related files.

You'd better not use pipenv and just make an anaconda env and install SUAVE with editable option (pip install -e .).

SeungKil-Paek avatar Jan 13 '21 05:01 SeungKil-Paek

I know that there are other ways to install it, but as I said before, in my opinion it would be great to change it such that you can directly use pipenv to install it. So far, this was possible with any other Python package I've encountered. I think that this can be a major source of confusion for inexperienced Python users who are used to the standard workflow when creating a project (pip + venv or pipenv).

danieljuschus avatar Jan 13 '21 09:01 danieljuschus

I have tried editing MANIFEST.in in trunk to detect README.md in the parent folder, but I can't get it to work. By the way, another workaround is to just copy README.md into trunk and change long_description to read('README.md')in setup.py. I still think it would be worth it to fix this!

danieljuschus avatar May 04 '21 14:05 danieljuschus