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
pipenv with some packages from conda #1469
Comments
Unfortunately, beyond the basic command line switch to make "system" packages visible from within the An initial draft of such a specification was developed a few years ago (see https://github.com/pypa/interoperability-peps/pull/30/files), so the best path for anyone wanting to move this forward would be:
Alternatively, the conda folks may be amenable to a feature request that teaches conda to read the |
Thanks for the answer, I thought pipenv is a wrapper around other tools to simplify things. Your second suggestion is not what I want. I want to define the source for each package. Because for some packages with C/C++ code I prefer conda, but for pure python I prefer pypi (newer versions). Then I will stay with my current workaround. |
Can I ask how exactly you did this and what exactly you mean by "working with". The most that I have been able to do is tell I would LOVE to be able to tell After that we could just use a Makefile to automate the installation logics. |
@xguse I think I didn't found the solution that you want. I meant with working, the new env was using the python interpreter from anaconda (I didn't explore it much because I stopped thinking about pipenv, when I heard that they do support conda as a second package manager). I do not care about envs. I wanted to automate my installation process on a new machine (i.e. download anaconda and install all dependencies. Some dependencies from conda, some from PyPi, some from git and some from path with editable). So I didn't care about a copy to a new environment but it is for me important, that I can define the source of a package like numpy. |
I believe conda packages for numpy, scipy, cython, etc. nowadays do include the .dist-info directories so that pip can see that they're installed, and use them for fulfilling wheel dependencies. (You still get into a mess if you try to upgrade those packages using pip, because pip and conda's idea about what packages are installed then gets out of sync. But as long as you never update those packages with pip, it should be OK.) The more complicated case would be if you wanted to use conda to install, say, MKL or openssl, and have pip-installed packages use those. That's what would need the infrastructure and PEP that @ncoghlan is referring to, I think. But I'm not sure this is relevant to the OP's problem. |
Thanks for the explanation. I was hoping that pipenv is a high-level tool, that can select the backend, e.g. Further, the lock file does not work with conda dependencies, so one main reason for me to use pipenv for reproducibility does not hold. |
@boeddeker The current expectation is that combinations of The fact that |
I understand your argumentation, I also understand that the way I use Your suggestions are good for a long-term solution but require much more effort to work. |
The proliferation of |
e.g. |
Sorta - unless you need to install numpy against a different version of openblas or with mkl extensions, but wheels have definitely made things way better. |
Also for me in bioinformatics, it is almost always the case that my project needs not only python libraries but r libs and straight compiled software. Not to mention that the Anaconda libs are usually faster. Conda is often the easiest way to get such projects provisioned in HPC environments. |
Yeah, I don't think pipenv is the right tool for you if you're working on those projects, basically. |
unless togglesitepackages works well enough for you. |
Note that " However, the That approach would better respect the layering described in http://www.curiousefficiency.org/posts/2016/09/python-packaging-ecosystem.html#platform-management-or-plugin-management, which points out that |
Agreed, Conda is a system package manager that happens to specialize mostly in Python packages. |
@kennethreitz: Yes I think that I am coming to the same conclusion. I just really like y'all's api and wish I could use it. I may just need to adjust my project automation logic to use conda for non-python and numpy, MKL stuff and pipenv for pure python and my pypi served projects. Do you see any glaring problems with invoking a conda env and then dropping into a pipenv subshell from inside the conda env? edit: and building the pipenv env with the conda site-packages exposed to it. |
I mean, there's nothing stopping you from:
|
great. |
"pipenv with a conda backend" makes perfect sense in principle. Conda (unlike apt-get) provides all the basic concepts that pipenv is built on: the ability to create isolated environments, resolve package requirements into specific pinned versions and install them in those environments, etc. Of course every project has to make hard decisions about how to spend limited resources, and my guess is that this is outside the scope of what the pipenv devs want or are able to prioritize right now, but the idea is coherent :-). |
Oh perfect! I tried to do |
The only issue with the --site-packages approach of course is that you end up with numpy that isn't backed by mkl. |
I guess someone just needs to build a condaenv (or whatever it could be called). It is obviously out of scope of Pipenv though. |
Here is my first answer on Stack Overflow: |
It is possible to specify dependencies inside the Pipfile that are installed from conda instead of pypi?
Somethink like this:
When I set up a new computer I install anaconda, then install some packages with conda install (e.g. numpy, scipy, cython, ...) and the remaining ones I install with pip install.
I was able to get pipenv working with conda but I do not know how I can define the dependencies from conda (Or if it is possible). Searching for an answer to my question I can only find people that mention that conda does not work with pipenv.
Describe your environment
$ python -V
Python 3.6.3 :: Anaconda custom (64-bit)$ pipenv --version
pipenv, version 9.0.3The text was updated successfully, but these errors were encountered: