jayniz / zsh-tmux-neovim-docker

Modern zsh/tmux/neovim setup in docker, with italics
https://jann.is/ipad-pro-for-programming/
148 stars 42 forks source link

ImportError: cannot import name 'main' #2

Open markojak opened 5 years ago

markojak commented 5 years ago

Trying this out and hitting this error on Mac OSX (Mojave) Docker 18.06.1-CE

Collecting pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
Installing collected packages: pip
  Found existing installation: pip 8.1.1
    Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Successfully installed pip-18.1
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'
The command '/bin/sh -c pip3 install --upgrade pip &&    pip3 install --user neovim jedi mistune psutil setproctitle' returned a non-zero code: 1
markojak commented 5 years ago

From here: https://github.com/pypa/pip/issues/5599

It may be that you're simply running the "wrong" wrapper script. Maybe you did a --user install of a new version of pip, but your PATH is set to run the system version of the wrapper rather than the user-local one installed with pip. In that case, you can simply fix your PATH. That's usually the issue for people who do pip install --user --upgrade pip and get the pip.main error.

I've done the following fixes

  1. Upgraded Docker-compose to latest version 1.23.1
  2. Removed the --user flag when using pip to install neovim
  3. Installing neovim 0.3.0 stable from PPA instead of building from source

I think (2) is relevant because do you really need the user flag given that this is running in a Docker environment? The --user flag doesn't become a problem in a virtual environment either so moot point I think.

Not sure if this breaks something else that was intended but will do a PR anyways