Python packaging tools not found

Answered

I'm attempting to configure PyCharm to work with an existing Django project but encountering difficulties getting it setup.

Project setup:

  • PyCharm runs on Windows 10
  • Django runs on CentOS 7 within a local Vagrant VirtualBox VM (config.vm.box = "bento/centos-7.2")
  • Python and all Python libraries are installed in a virtual environment (venv) within the VM

PyCharm steps I've done so far:

  1. Setup Vagrant from Settings > Tools > Vagrant.
  2. Enabled Django support from Settings > Languages & Frameworks > Django. Set the project root, settings, and manage script.

I'm now trying to configure the remote Python interpreter, but that step is failing.

  • From Settings > Project: XYZ > Project Interpreter, I selected "Add Remote", "Vagrant", verified the Vagrant instance folder is correct, and entered the Python interpreter path for running Python within the venv on Vagrant.
  • PyCharm connects to Vagrant but then displays the error: Could not load private key from "org.apache.commons.vfs2.provider.sftp.IdentityInfo@489330be".

  • If I click "Save anyway", the project interpreter is listed as "[incomplete]" and none of the Python packages are displayed.

  • If I click the link "Install packaging tools", I get the error: "Cannot find external tool: packaging_tool.py".

pip is correctly installed within the venv and works; however, I don't have any tool named "packaging_tool.py" installed in the venv (or anywhere in the Vagrant VM).

Is there a special package that I need to install within my venv in order to setup a remote interpreter on PyCharm? Or is there something else I need to do to get this step working? Thank you in advance for any help you can give on this!

 

0
5 comments

Hi Gnorizo! Could you please run vagrant ssh-config from the terminal inside your project root and provide output here? What vagrant version do you have installed? I found a similar problem in our bug tracker: https://youtrack.jetbrains.com/issue/PY-14799#comment=27-2427062

0
Avatar
Permanently deleted user

"vagrant ssh-config" returns:

 
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /cygdrive/c/Users/MyUsername/Documents/dev/XYZ/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
0

Thank you, could you please also specify vagrant version? Is it 2.0.0?

vagrant --version
0
Avatar
Permanently deleted user

Yes, we're using Vagrant 2.0.0 because it fixes a longstanding bug in 1.8.x re: "salt.minion_id" in the Vagrantfile. The bug caused the wrong Salt target to execute during provisioning, thus failing to setup the VM properly. Vagrant 2.0.0 now handles this properly.

0

I'm running into this issue with docker after upgrading to 2018.3, strangely for me is it was working great on the previous 2018.2.6 version. Nothing has changed in the container, only pycharm.

How did you solve this?

2

Please sign in to leave a comment.