asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

Can't use globally installed tools in project with local python version (Black tool) #109

Open Ceridan opened 3 years ago

Ceridan commented 3 years ago

I have two python versions installed via asdf:

I use 3.9.6 as a global version, and for my python project I set up a local version to 3.8.11. I have installed Black tool globally to integrate it with my IDE. I specify the full path to Black executable in PyCharm External Tools settings. It works everywhere except my project folder. I see the following output:

/home/user/.asdf/shims/black /home/user/repos/myproject/foo.py
grep: python 3.9.6
python system: No such file or directory
No preset version installed for command black
Please install a version by running one of the following:

asdf install python 3.8.11

or add one of the following versions in your config file at /home/user/repos/myproject/.tool-versions
python 3.9.6

My .tool-versions inside the project looks like this:

python 3.8.11

If I change it to 3.9.6 the Black tool is starting to work properly. But I do not want to fix it like this, I want to use python 3.8.11 with my project, and want to use Black as an external tool. Also, I tried to run asdf reshim python it doesn't fix problem too.

Could you help me with how to fix this problem?