-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pip install sherpa bug #828
Comments
Yes, the current sherpa install scripts require numpy to be available in the environment already. That's because the We are working on changes to the package that will solve this in the future (#782, #784), but for now you simply have to install numpy in some way before you install sherpa (e.g. |
Thanks for the reply. Pip still does not install sherpa after numpy is installed. In the initial issue, I tried to There is nothing mentioned in the installation instructions about installing bison. I don't see why pip requires bison to install sherpa, but conda can install it easily. |
Bison is needed for a source install and I think that's happening here with pip (There are no binary wheels for sherpa on pypi ). You can see all the output from the Thanks you for reporting; it's not always easy to know how users actually use sherpa "in the wild". May I ask if this is something you just came across by chance or is it important for you to be able to install sherpa from with pip (instead of conda)? |
Sorry, I should have added that bison is not a Python package, it's part of the usual system compiler tools together with the gcc compiler etc. |
Okay that makes sense, thanks! I had planned on using sherpa as a requirement in a package I'm working on, and found the issue when trying to pip install the package's requirements in a new env. I must have used conda to install it while developing, and just noticed the issue now while testing the install of my package. |
The pip-installation section at https://sherpa.readthedocs.io/en/latest/install.html#using-pip should be updated (probably to say "please follow the source-installation" instructions). |
@klaykulik : How much of a problem is the current behaviour for you, or in other words, how hard should we work to fix this? (Just trying to a a vote from you as a "user" to help guide if we should focus our work in installation, or new features, or improved plotting etc... |
It's not a big deal, I can work around it. I just wanted to make sure you were aware of the issue. Thanks again! |
We have just merged #782 into master which means |
Hello, |
@ThaisGuerini - is there any information on why it failed? |
@DougBurke thanks for replying.
The error message is the following:
Collecting sherpa
Downloading https://files.pythonhosted.org/packages/49/6a/6da658a35d7f0e1b70353a7bef8f15488629448fae2ddb259ff8008c7070/sherpa-4.12.2.tar.gz (12.0MB)
|████████████████████████████████| 12.0MB 334kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from sherpa) (1.18.5)
Building wheels for collected packages: sherpa
Building wheel for sherpa (PEP 517) ... error
ERROR: Failed building wheel for sherpa
Running setup.py clean for sherpa
Failed to build sherpa
ERROR: Could not build wheels for sherpa which use PEP 517 and cannot be installed directly
|
Well, that's not particularly helpful! My guess is that you are missing one of the compilation tools we need (possibly flex or bison but you also need gcc, g++, and make). There's a note about it at https://sherpa.readthedocs.io/en/latest/install.html#building-from-source but it's not obvious how to tell python these non-python requirements (unless it's in PEP 517 or related and we just don't take advantage of it). |
You could try
and see if that gives useful information. Or use the --log option to |
Sorry to bother you again. |
Are you running this from within an ipython or jupyter notebook? If so, is this a local environment or something like Google's colab? |
I am running it from the Google's Colab website. |
What you would have needed to do was run the commands with each line starting with a ! as they are shell commands, not python. Unfortunately, the colab system doesn't contain the necessary tools to build Sherpa - you would see an error like the following if you had unpacked the directory
I don't have experience with colab to know if there's ways to install software or to add the conda package manager. |
@hamogu - I believe you have 'Google colab' knowledge that may be useful here. |
Try this in colab to get conda:
Then, install whatever conda packages you want with conda:
Because you can't activate the conda environment from within colab, you have to manually add the path. I use the following, you might get away with not adding all of them, that depends on what other packages are installed, but there is no harm in listing too many packages, so I'll just give you what I use:
Note however, that this is not an officially support way of using Sherpa. We're happy to hear feedback from you and will try to help, but we many not have solutions to all problems you could encounter. |
I forgot, in colab, always install python=3.6 in conda calls, so that all packages match the python version that colab runs on:
|
@hamogu I tried what you suggested, but, unfortunately, I got an error message telling me the package isn't available. |
I don't know what's different for you - but here is an example that works for me: You have not told us much about your use case, so it's hard to give advice beyond of exact question "How do I install ...?". However, let me just say that Sherpa is of course made for a specific use case (fitting of X-ray data) where I think it's capabilities are almost unique in the Python world. On the other hand, Sherpa is also good for other things (fitting other spectra or any data really). In that capacity, Sherpa is not unique. There are certainly other packages to do that and if that's what you are looking for, then I would not necessarily bother with Sherpa if the installation is a headache for you. Since you indicated that you are going to try other packages, I'm going to close this issue, but feel free to re-open if you have any follow-up questions. |
Sherpa does not seem to want to install on a clean venv using Pip, but installs fine with conda.
Commands Only:
Commands and output/errors:
The text was updated successfully, but these errors were encountered: