Skip to content
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

installation #2

Closed
Justin318 opened this issue Feb 14, 2018 · 6 comments
Closed

installation #2

Justin318 opened this issue Feb 14, 2018 · 6 comments

Comments

@Justin318
Copy link

The installation of gvar requires installation of numpy and cython before hand, although both packages have been specified in the install_requires of setup.py. Is that caused by the fact that setup.py import numpy and cython? Could you do something like

`
import pip

try:
import Cython
import numpy
except ImportError:
pip.main(['install', 'cython', 'numpy'])
`
at the top of the setup.py file to remove the requirment on the user to install those manually.

@gplepage
Copy link
Owner

You are correct that the issue is setup.py needing cython and numpy in order to run. I also agree that it would be nice if this wasn't an issue.

It is tempting to do something like what you suggest. A problem, however, is that people using pip exercise control over what and where stuff gets installed. That control is lost if setup.py does its own independent installing. For example, the code you propose tries to install cython/numpy in the system's library, which may or may not be accessible to the person doing the installation. One could add a '--user' flag to have cython/numpy installed in the user's library, but that will cause problems, for example, if someone with access installs gvar in the system's library, so it can be used by everyone. I don't see a simple way around this sort of problem. Installing in the user's library also messes up environments.

@Justin318
Copy link
Author

Thanks. I see your concern. My main problem is that once I add gvar to my package's dependency and send my package to continuous integration, it throws an error of missing cython/numpy.

@gplepage
Copy link
Owner

I have had similar problems myself.

I just got an idea for how to fix this, but it is going to take a while (a week, maybe) before I can get to it. I will get back to you when I finish.

@gplepage
Copy link
Owner

Try the latest verion (8.3.4). I think it might work now.

@gplepage
Copy link
Owner

The current version (8.3.5) installs properly in every environment I have been able to test. Installation no longer requires cython. And numpy is installed automatically if it isn't present. Installation is probably a bit faster, as well, because cython isn't used.

@gplepage
Copy link
Owner

I am closing this issue because I believe it is resolved. Please open a new issue if I am wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants