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

Install this package failed within the conda env managed by pyenv. #4

Closed
hongyi-zhao opened this issue Dec 19, 2019 · 6 comments
Closed

Comments

@hongyi-zhao
Copy link

Hi,

I use the pyenv to install and manage the anaconda python distribution as follows:

$ pyenv install anaconda3-4.3.0

Then I enable this environment for my project:

$ mkdir myproject
$ cd myproject
$ pyenv local anaconda3-4.3.0

Then I try to install the git version of conda-bash-completion into this environment as follows:

$ conda install git pip

Then try install as follows but failed:

$ pip install git+https://github.com/tartansandal/conda-bash-completion.git
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting git+https://github.com/tartansandal/conda-bash-completion.git
  Cloning https://github.com/tartansandal/conda-bash-completion.git to /tmp/pip-req-build-fufeggnh
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/werner/.pyenv/versions/anaconda3-4.3.0/envs/Python3/lib/python3.5/tokenize.py", line 454, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-fufeggnh/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-fufeggnh/
You are using pip version 10.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
@tartansandal
Copy link
Owner

First, conda-bash-completion is not a python package. Note how it does not have a setup.py file.
That is what the following line in the error output is referring to:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-fufeggnh/setup.py'

Rather than using python setuptools, this project uses conda "recipes" to manage its installation.
New releases are generally available within an hour or so from conda-forge. It only makes sense to install this via conda, or via the manual methods described in the README. Using pip is never going to work.

@tartansandal
Copy link
Owner

Second, using both PyEnv and Anaconda at the same time is unusual. Both allow you to manage environments and manage projects using different versions of Python. PyEnv is much simpler and specific to Python, whereas Anaconda is more complex, has more features, and is not redistricted to just Python. Using both at the same time will lead to some confusion. You may be better off sticking to one of the two for any project.

The following creates and activates a python-3.6 environment.

conda create -n myenv python=3.6
conda activate myenv

Check out https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html# for more details, especially on maintaining lists of environment packages.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Dec 19, 2019 via email

@tartansandal
Copy link
Owner

Thanks @hongyi-zhao. It's an interesting approach, but IMHO it does add multiple layers of complexity that may cause problems later on.

The recommended advice is currently to do all your 'pip' actions inside a conda environment. (See https://www.anaconda.com/using-pip-in-a-conda-environment/). This is the opposite of what the above blog suggests 😞

There is a new experimental 'pip' interoperability mode https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/pip-interoperability.html that can be of some help.

You may find the following helpful: https://www.anaconda.com/understanding-conda-and-pip/.

@tartansandal
Copy link
Owner

Anyway. Enjoyable discussion 😄, but I'm going to close the issue since it was a simple misunderstanding about the nature of this project, and conda-bash-completion will likely never be pip install.

@hongyi-zhao
Copy link
Author

Thanks @hongyi-zhao. It's an interesting approach, but IMHO it does add multiple layers of complexity that may cause problems later on.

The recommended advice is currently to do all your 'pip' actions inside a conda environment. (See https://www.anaconda.com/using-pip-in-a-conda-environment/). This is the opposite of what the above blog suggests disappointed

There is a new experimental 'pip' interoperability mode https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/pip-interoperability.html that can be of some help.

Thanks a lot for you to let me know this interesting and magic feature.

Regards

You may find the following helpful: https://www.anaconda.com/understanding-conda-and-pip/.

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