Discovering / accessing binary modules in protected folder
I am using the python version that comes with QGIS 3.22 (it's Python 3.9), which has the psycopg2 module. More accurately, it is the psycopg2-binary module, although I do not have an understanding of how these binaries are executed either bei QGIS or PyCharm. Anyway, I cannot access the module from PyCharm, although I can access it from the python console in QGIS. They are using the same Python.exe and all the other modules are working just fine (numpy, PyQt5, gdal, ...).
I believe it has to do with the strict IT security policy of the administration I am working at. I cannot change anything that is in the C:\Program Files. My best guess is that upon setting the python interpreter, PyCharm installes the binary module ("Discovering binary modules...") but fails due to lacking access.
Is this a valid assumption or am I wrong here? Any ideas on how to solve this?
Please sign in to leave a comment.
PyCharm uses static code analysis of Python code. For some files that are not of *.py extension, we generate "skeletons", which are basically Python files containing the code that we were able to find in those non-Python files. The list of the extensions for which we do that can be found here https://github.com/JetBrains/intellij-community/blob/f85dcc7c61df0d0da2012eb3cadeb583005aa969/python/helpers/generator3/core.py#L62
Binary files require additional support from our side so it worth filing a feature request to https://youtrack.jetbrains.com/issues/PY
Or you can vote for https://youtrack.jetbrains.com/issue/PY-9510
Thank you, Sergey. I opened a new issue on YouTrack about it!