EnterpriseDB / edb-installers

PostgreSQL installers packaged by EDB
22 stars 7 forks source link

Stackbuilder by default installs Python into a directory without user writing rights #100

Closed Vuizur closed 4 months ago

Vuizur commented 6 months ago

When installing Python from the official Python website with the default settings, it gets installed under C:/Python10 and the user has full rights to modify this folder: image With the Stackbuilder language pack, the default settings prevent user modification (here shown for the folder under C:/edb/languagepack/v4/Python-3.11): image

I think that this fact causes the following warning ("normal site-packages not writable") when trying to globally install a package. Like in this SO post: https://stackoverflow.com/questions/59997065/pip-python-normal-site-packages-is-not-writeable (It causes the packages to be installed somewhere else, so that it works from the command line, but not in PL/Python.)

Vuizur commented 6 months ago

I discovered a bit more and think that this is pretty clearly an wrong thing to do, which especially can be seen when running python -v, which throws a bunch of errors.

PS C:\Users\hanne\Documents\Programme> python -v
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'nt' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# bytecode is stale for 'encodings'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\encodings\__init__.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\encodings\\__pycache__\\__init__.cpython-311.pyc': PermissionError(13, 'Permission denied')
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <class '_frozen_importlib.FrozenImporter'>
# bytecode is stale for 'encodings.aliases'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\encodings\aliases.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\encodings\\__pycache__\\aliases.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD237F10>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD217790>
# bytecode is stale for 'encodings.utf_8'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\encodings\utf_8.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\encodings\\__pycache__\\utf_8.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD235D10>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <class '_frozen_importlib.FrozenImporter'>
import 'io' # <class '_frozen_importlib.FrozenImporter'>
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <class '_frozen_importlib.FrozenImporter'>
import '_collections_abc' # <class '_frozen_importlib.FrozenImporter'>
import 'genericpath' # <class '_frozen_importlib.FrozenImporter'>
import '_winapi' # <class '_frozen_importlib.BuiltinImporter'>
import 'ntpath' # <class '_frozen_importlib.FrozenImporter'>
import 'os' # <class '_frozen_importlib.FrozenImporter'>
import '_sitebuiltins' # <class '_frozen_importlib.FrozenImporter'>
Processing user site-packages
Adding directory: 'C:\\Users\\hanne\\AppData\\Roaming\\Python\\Python311\\site-packages'
Processing global site-packages
Adding directory: 'C:\\edb\\languagepack\\v4\\Python-3.11'
Adding directory: 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\site-packages'
Processing .pth file: 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\site-packages\\distutils-precedence.pth'
# bytecode is stale for '_distutils_hack'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\site-packages\_distutils_hack\__init__.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\site-packages\\_distutils_hack\\__pycache__\\__init__.cpython-311.pyc': PermissionError(13, 'Permission denied')
import '_distutils_hack' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5238D0>
import 'site' # <class '_frozen_importlib.FrozenImporter'>
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\rlcompleter.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\rlcompleter.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# bytecode is stale for 'inspect'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\inspect.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\inspect.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 'ast'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\ast.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\ast.cpython-311.pyc': PermissionError(13, 'Permission denied')
import '_ast' # <class '_frozen_importlib.BuiltinImporter'>
# bytecode is stale for 'contextlib'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\contextlib.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\contextlib.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 'collections'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\collections\__init__.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\collections\\__pycache__\\__init__.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# bytecode is stale for 'keyword'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\keyword.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\keyword.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5D0890>
# bytecode is stale for 'operator'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\operator.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\operator.cpython-311.pyc': PermissionError(13, 'Permission denied')
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD56BED0>
# bytecode is stale for 'reprlib'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\reprlib.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\reprlib.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD56BFD0>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5C3C10>
# bytecode is stale for 'functools'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\functools.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\functools.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 'types'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\types.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\types.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD56BC50>
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5C3C90>
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5436D0>
# bytecode is stale for 'enum'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\enum.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\enum.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'enum' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5C1F50>
import 'ast' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD5428D0>
# bytecode is stale for 'dis'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\dis.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\dis.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 'opcode'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\opcode.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\opcode.cpython-311.pyc': PermissionError(13, 'Permission denied')
import '_opcode' # <class '_frozen_importlib.BuiltinImporter'>
import 'opcode' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD59B690>
import 'dis' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD542D50>
# bytecode is stale for 'collections.abc'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\collections\abc.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\collections\\__pycache__\\abc.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD543550>
# bytecode is stale for 'importlib'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\importlib\__init__.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\importlib\\__pycache__\\__init__.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 'warnings'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\warnings.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\warnings.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDCF89D0>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDCF8950>
import 'importlib.machinery' # <class '_frozen_importlib.FrozenImporter'>
# bytecode is stale for 'linecache'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\linecache.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\linecache.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 'tokenize'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\tokenize.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\tokenize.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 're'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\re\__init__.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\re\\__pycache__\\__init__.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 're._compiler'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\re\_compiler.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\re\\__pycache__\\_compiler.cpython-311.pyc': PermissionError(13, 'Permission denied')
import '_sre' # <class '_frozen_importlib.BuiltinImporter'>
# bytecode is stale for 're._parser'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\re\_parser.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\re\\__pycache__\\_parser.cpython-311.pyc': PermissionError(13, 'Permission denied')
# bytecode is stale for 're._constants'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\re\_constants.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\re\\__pycache__\\_constants.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 're._constants' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDD21E90>
import 're._parser' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDD2AD50>
# bytecode is stale for 're._casefix'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\re\_casefix.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\re\\__pycache__\\_casefix.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 're._casefix' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDDDCE10>
import 're._compiler' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDD15710>
# bytecode is stale for 'copyreg'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\copyreg.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\copyreg.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'copyreg' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDDDF410>
import 're' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD50F910>
# bytecode is stale for 'token'
# code object from C:\edb\languagepack\v4\Python-3.11\Lib\token.py
# could not create 'C:\\edb\\languagepack\\v4\\Python-3.11\\Lib\\__pycache__\\token.cpython-311.pyc': PermissionError(13, 'Permission denied')
import 'token' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDD29350>
import 'tokenize' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FDCF9B50>
import 'linecache' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD59AF90>
import 'inspect' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD52E890>
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x000002C3FD523E10>
Python 3.11.7 (main, Feb  6 2024, 11:44:07) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
sandeep-edb commented 5 months ago

OK. Is Benutzer the user that ran the elevated installation? and the expectation is that this user should have full access to Python sub-directory?

Vuizur commented 5 months ago

Yes, Benutzer is German for user and there is only one user on my machine.

and the expectation is that this user should have full access to Python sub-directory?

Yes, I think anything else would be a bug.

sandeep-edb commented 4 months ago

The fix is committed for LanguagePack v2, v3 and v4 and will be part of upcoming minor updates for LPinstallers

Vuizur commented 4 months ago

Awesome, thanks 👍

Dne út 7. 5. 2024 7:47 uživatel Sandeep Thakkar @.***> napsal:

The fix is committed for LanguagePack v2, v3 and v4 and will be part of upcoming minor updates for LPinstallers

— Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/edb-installers/issues/100#issuecomment-2097496252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG66XKKPKJ2E3W6M3ACLL7DZBBTGZAVCNFSM6AAAAABEG4NGOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJXGQ4TMMRVGI . You are receiving this because you authored the thread.Message ID: @.***>

sandeep-edb commented 4 months ago

The new versions for LanguagePack are available in StackBuilder for download. I'm closing the ticket. Should you encounter the issue, please re-open the ticket. Thank you