Closed Twiggeh closed 3 years ago
I'm not entirely sure what is wrong. This like looks suspicious: OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-8f_jz32e/lib/python/ptvsd' -> '/usr/lib/python3.8/site-packages/ptvsd'
. Not sure what it is doing there exactly.
Does it work when you run import ptvsd
in the Python Console within Blender? Does Blender use the Python version from the system or its own (usually things might be a bit easier when it uses its own, because then there are less cases to worry about)?
I think its using the systems' python install but I am not sure how to check that.
import ptvsd
gave the error no module named ptvsd
The "no module named ptvsd" is not exclusive to ptvsd, flask doesn't work either, but requests does.
If I run the task runner with sudo permissions it launches blender & there are no issues, but i can't figure out how to do that from within the extension
You are using the system python version (which 3.8.3 in your case). Blender comes with Python 3.7.7 currently.
Can you run import sys; import pprint; pprint.pprint(sys.path)
in Blender, to check where it looks for modules?
requests
probably works, because it is bundled with Blender.
output of import sys; import pprint; pprint.pprint(sys.path)
>>> import sys; import pprint; pprint.pprint(sys.path)
['/usr/share/blender/2.83/scripts/startup',
'/usr/share/blender/2.83/scripts/modules',
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload',
'/usr/lib/python3.8/site-packages',
'/usr/share/blender/2.83/scripts/freestyle/modules',
'/usr/share/blender/2.83/scripts/addons/modules',
'/home/twiggeh/.config/blender/2.83/scripts/addons/modules',
'/usr/share/blender/2.83/scripts/addons',
'/home/twiggeh/.config/blender/2.83/scripts/addons',
'/usr/share/blender/2.83/scripts/addons_contrib']
If I interpret you terminal output correctly, pip installed flask and probably also ptvsd in ./local/lib/python3.8/site-packages
. However, Blender does not look in that path, because that path is not in sys.path
. Instead, Blender uses a global Python installation which has it's site packages in /usr/lib/python3.8/site-packages
. You could try to make pip install the packages in the global directory instead. I just tested it on my system, and it seems to work when I just use sudo pip ...
.
This is probably related to this message in your terminal output: Defaulting to user installation because normal site-packages is not writeable
.
Ok so it works if I force VSC to run in sudo mode. I will try running pip with sudo!
It worked! Thank you a lot :D The Solution was uninstalling and reinstalling the packages with sudo
(Despite it saying that the requirement was already fullfilled in /usr/lib/python... )
You are using the system python version (which 3.8.3 in your case). Blender comes with Python 3.7.7 currently.
I am getting a similar error but I am using Blender 2.90.1. Does it work with Blender 2.90.1? The Python version in my path seems to be 3.8.5.
found bundled python: c:\Program Files\Blender Foundation\Blender 2.90\2.90\python
[]
Collecting ptvsd
Using cached ptvsd-4.3.2-cp37-cp37m-win_amd64.whl (5.1 MB)
Installing collected packages: ptvsd
Successfully installed ptvsd-4.3.2
ERROR: Exception:
Traceback (most recent call last):
File "c:\Program Files\Blender Foundation\Blender 2.90\2.90\python\lib\shutil.py", line 566, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\(user name)\\AppData\\Local\\Temp\\pip-target-nylmyiga\\lib\\python\\ptvsd' -> 'c:\\Program Files\\Blender Foundation\\Blender 2.90\\2.90\\python\\lib\\site-packages\\ptvsd'
When I checked the path 'C:\Users\(user name)\AppData\Local\Temp\pip-target-nylmyiga\lib\python\ptvsd' (with \ replaced with ), there was no such directory as pip-target-nylmyiga
.
I've installed ptvsd with pip & I enabled
blender.allowModifyExternalPython
as well. I am not sure what to do here.