SUAVE
SUAVE copied to clipboard
Installation fails with pipenv
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?
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.
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.
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 .).
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).
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!