-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process. #39
Comments
I like to use this in Siemens NX during Manufacturing Machine Simulation because I wrote my own Python files. If I run a journal then I can setup the script with Global Interpreter Lock and the encrypted script works perfectly a couple of times after eachother. |
Hi! The pyencrypt-pye/pyencrypt/loader.py Line 97 in 32db20c
|
Hi,
I have attached to log files from Siemens NX.
In the 1st-time.txt you see a lot of modules loaded and the encrypted files
are decrypted. The 2nd-time.txt shows a lot less modules loaded. You see
that loader is still loaded but not cython and a lot of others. So the
files are not decrypted.
Regards,
Jacco Loonstra
[image: python-file.jpg]
Op vr 30 aug 2024 om 18:12 schreef Qi Zhao ***@***.***>:
Hi! The loader doesn't need to be loaded again. It simply inserte
EncryptFileFinder to sys.meta_path once.
Can you provide more information, such as a small demo?
https://github.com/ZhaoQi99/pyencrypt-pye/blob/32db20cb64dab040d40abfb410518f511b5e290f/pyencrypt/loader.py#L97
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGHFLBGOGIABM2CMN7TLF3ZUCKYRAVCNFSM6AAAAABNMVONH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRRHAYTMMRYGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Successfully loaded dynamic module Q:\CADCAM\NX\NX2406\_Network_Install\3002\NXBIN\libcamcsepython.dll
Loaded module q:\cadcam\nx\nx2406\_network_install\3002\nxbin\libcamcsepython.dll 7ffb69700000 26000 9788e943-47de7175-d348f0b4-c9ad3f74-1=libcamcsepython___171884870364 version = 2406.2525.0.0
Successfully loaded dynamic module Q:\CADCAM\NX\NX2406\_Network_Install\3002\nxbin\python\python310.dll
Loaded module q:\cadcam\nx\nx2406\_network_install\3002\nxbin\python\python310.dll 7ffac8740000 4d2000 b0bedaa1-47607214-3c7a2fb8-2767e1ca-1 version = 3.10.12150.1013
william_CSETNC
Python(stdout): sys
Python(stdout): builtins
Python(stdout): _frozen_importlib
Python(stdout): _imp
Python(stdout): _thread
Python(stdout): _warnings
Python(stdout): _weakref
Python(stdout): _io
Python(stdout): marshal
Python(stdout): nt
Python(stdout): winreg
Python(stdout): _frozen_importlib_external
Python(stdout): time
Python(stdout): zipimport
Python(stdout): zlib
Python(stdout): _codecs
Python(stdout): codecs
Python(stdout): encodings.aliases
Python(stdout): encodings
Python(stdout): encodings.utf_8
Python(stdout): encodings.cp1252
Python(stdout): _abc
Python(stdout): abc
Python(stdout): io
Python(stdout): __main__
Python(stdout): _stat
Python(stdout): stat
Python(stdout): _collections_abc
Python(stdout): genericpath
Python(stdout): _winapi
Python(stdout): ntpath
Python(stdout): os.path
Python(stdout): os
Python(stdout): _sitebuiltins
Python(stdout): importlib._bootstrap
Python(stdout): importlib._bootstrap_external
Python(stdout): warnings
Python(stdout): importlib
Python(stdout): importlib.machinery
Python(stdout): sitecustomize
Python(stdout): site
Python(stdout): CSE
Python(stdout): CSEImporter
Python(stdout): CSETNC
Python(stdout): NXOpen.GeometricUtilities.UVMapping
Python(stdout): NXOpen.GeometricUtilities
Python(stdout): NXOpen.Report
Python(stdout): NXOpen.Display
Python(stdout): NXOpen.Drafting
Python(stdout): NXOpen.Gateway
Python(stdout): NXOpen.Annotations
Python(stdout): NXOpen.Fields
Python(stdout): NXOpen.CAE.FTK
Python(stdout): NXOpen.CAE.QualityAudit
Python(stdout): NXOpen.CAE.Magnet
Python(stdout): NXOpen.CAE.PostProc
Python(stdout): NXOpen.CAE.ModelCheck
Python(stdout): NXOpen.CAE.ModelDependencyCheck
Python(stdout): NXOpen.CAE.RotorDynamics
Python(stdout): NXOpen.CAE.ResponseSimulation
Python(stdout): NXOpen.CAE.Optimization
Python(stdout): NXOpen.CAE.PenetrationCheck
Python(stdout): NXOpen.CAE.MeshMapping
Python(stdout): NXOpen.CAE.Connections
Python(stdout): NXOpen.CAE.ContactPreview
Python(stdout): NXOpen.CAE.AeroStructures
Python(stdout): NXOpen.CAE.AeroStructures.Author
Python(stdout): NXOpen.CAE.Safety
Python(stdout): NXOpen.CAE.Xyplot
Python(stdout): NXOpen.CAE
Python(stdout): NXOpen.Features.ShipDesign
Python(stdout): NXOpen.Issue
Python(stdout): NXOpen.Features.Industry
Python(stdout): NXOpen.Features.ShipDesign.GeneralArrangement
Python(stdout): NXOpen.Features.Subdivision
Python(stdout): NXOpen.Features.AECDesign
Python(stdout): NXOpen.Validate.Corrosion
Python(stdout): NXOpen.Validate
Python(stdout): NXOpen.GeometricAnalysis.SectionAnalysis
Python(stdout): NXOpen.GeometricAnalysis
Python(stdout): NXOpen.Tooling
Python(stdout): NXOpen.Features.StructureDesign
Python(stdout): NXOpen.Features.PlatformTestNamespace1
Python(stdout): NXOpen.Features.PlatformTestNamespace2
Python(stdout): NXOpen.Features.DrawShapes
Python(stdout): NXOpen.Features.VehicleDesign
Python(stdout): NXOpen.Features.SheetMetal
Python(stdout): NXOpen.Features
Python(stdout): NXOpen
Python(stdout): cython_runtime
Python(stdout): _cython_3_0_11
Python(stdout): itertools
Python(stdout): keyword
Python(stdout): _operator
Python(stdout): operator
Python(stdout): reprlib
Python(stdout): _collections
Python(stdout): collections
Python(stdout): collections.abc
Python(stdout): types
Python(stdout): enum
Python(stdout): _sre
Python(stdout): sre_constants
Python(stdout): sre_parse
Python(stdout): sre_compile
Python(stdout): _functools
Python(stdout): functools
Python(stdout): _locale
Python(stdout): copyreg
Python(stdout): re
Python(stdout): _struct
Python(stdout): struct
Python(stdout): binascii
Python(stdout): base64
Python(stdout): _weakrefset
Python(stdout): weakref
Python(stdout): copy
Python(stdout): posixpath
Python(stdout): fnmatch
Python(stdout): errno
Python(stdout): urllib
Python(stdout): urllib.parse
Python(stdout): pathlib
Python(stdout): _hashlib
Python(stdout): _blake2
Python(stdout): hashlib
Python(stdout): _json
Python(stdout): json.scanner
Python(stdout): json.decoder
Python(stdout): json.encoder
Python(stdout): json
Python(stdout): _socket
Python(stdout): math
Python(stdout): select
Python(stdout): selectors
Python(stdout): socket
Python(stdout): _signal
Python(stdout): signal
Python(stdout): threading
Python(stdout): contextlib
Python(stdout): msvcrt
Python(stdout): subprocess
Python(stdout): _uuid
Python(stdout): uuid
Python(stdout): _datetime
Python(stdout): datetime
Python(stdout): token
Python(stdout): tokenize
Python(stdout): linecache
Python(stdout): traceback
Python(stdout): importlib._abc
Python(stdout): typing.io
Python(stdout): typing.re
Python(stdout): typing
Python(stdout): importlib.abc
Python(stdout): importlib.util
Python(stdout): loader
william_kees
william_CseTNC_Yacc This file is encrypted
william_CSETNC_Lex This file is encrypted
william_CSEUtils
william_CseTNC_Metacodes This file is encrypted
william_CseTNC_Methods This file is encrypted
william_CSETNC_Controller___init__
william_CSETNC_Controller_Initialize
MESSAGE_BOX displayed: Sat Aug 31 17:19:00 2024 W. Europe Daylight Time
&MACRO MESSAGE_BOX -2, Error 1067542 - Aeronamic B.V.
MESSAGE_BOX acknowledged: Sat Aug 31 17:19:04 2024 W. Europe Daylight Time
william_CSETNC_ControllerState___init__
william_CSETNC_ControllerState_InitializeChannel
william_CSETNC_Controller_InitializeChannel
william_CSETNC_ControllerState___init__
william_CSETNC_ControllerState_InitializeChannel
william_CSETNC_Controller_InitializeChannel
william_CSETNC_ControllerState___init__
william_CSETNC_ControllerState_InitializeChannel
william_CSETNC_Controller_InitializeChannel
william_CSETNC
Python(stdout): sys
Python(stdout): builtins
Python(stdout): _frozen_importlib
Python(stdout): _imp
Python(stdout): _thread
Python(stdout): _warnings
Python(stdout): _weakref
Python(stdout): _io
Python(stdout): marshal
Python(stdout): nt
Python(stdout): winreg
Python(stdout): _frozen_importlib_external
Python(stdout): time
Python(stdout): zipimport
Python(stdout): zlib
Python(stdout): _codecs
Python(stdout): codecs
Python(stdout): encodings.aliases
Python(stdout): encodings
Python(stdout): encodings.utf_8
Python(stdout): encodings.cp1252
Python(stdout): _abc
Python(stdout): abc
Python(stdout): io
Python(stdout): __main__
Python(stdout): _stat
Python(stdout): stat
Python(stdout): _collections_abc
Python(stdout): genericpath
Python(stdout): _winapi
Python(stdout): ntpath
Python(stdout): os.path
Python(stdout): os
Python(stdout): _sitebuiltins
Python(stdout): importlib._bootstrap
Python(stdout): importlib._bootstrap_external
Python(stdout): warnings
Python(stdout): importlib
Python(stdout): importlib.machinery
Python(stdout): sitecustomize
Python(stdout): site
Python(stdout): CSE
Python(stdout): CSEImporter
Python(stdout): CSETNC
Python(stdout): NXOpen
Python(stdout): loader
william_kees
william_CSEUtils
The Python script 'CSETNC' could not be loaded.
'TRANS_DATUM_RESET'
Traceback (most recent call last):
File "Q:\CADCAM\NX\NXMACH\resource\library\machine\installed_machines\1072_HermleC32U\cse_driver_jacco\heidenhainTNC\CSETNC.py", line 15, in <module>
import CseTNC_Kees
File "Q:\CADCAM\NX\NXMACH\resource\library\machine\installed_machines\1072_HermleC32U\cse_driver_jacco\heidenhainTNC\CseTNC_Kees.py", line 19, in <module>
import CseTNC_Yacc this file is encrypted, but does not get encrypted
File "Q:\CADCAM\NX\NX2406\_Network_Install\3002\mach\auxiliary\cse\CseTNC_Yacc.py", line 13, in <module>
import CseTNC_Lex
File "Q:\CADCAM\NX\NX2406\_Network_Install\3002\mach\auxiliary\cse\CseTNC_Lex.py", line 291, in <module>
@lex.TOKEN(regexDict['TRANS_DATUM_RESET'])
KeyError: 'TRANS_DATUM_RESET'
|
I didn't find any logs related to |
Hi,
The attached logs are from the most simple use as in....encrypt files and
import loader. Then first time it works, second time not.
The Importerror: Interpreter change detected.....I have to change my script
a little bit, but I can't remember what I changed in the script. I have to
figure this out again.
I will come back to you, when I have it.
Regards,
Jacco
Op ma 2 sep 2024 om 05:46 schreef Qi Zhao ***@***.***>:
… I didn't find any logs related to ImportError in the traceback you
provided.
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGHFLBIRUH7VEDG2TWD7NTZUPNS7AVCNFSM6AAAAABNMVONH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTG42TMOJYGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Can you provide a small demo and tell me how you call python the second time? |
Hi,I can, but this next 8 days I'm on holiday.Regards,JaccoVerzonden vanaf mijn Galaxy
-------- Oorspronkelijk bericht --------Van: Qi Zhao ***@***.***> Datum: 02-09-2024 11:51 (GMT+01:00) Aan: ZhaoQi99/pyencrypt-pye ***@***.***> Cc: Bird23 ***@***.***>, Author ***@***.***> Onderwerp: Re: [ZhaoQi99/pyencrypt-pye] ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process. (Issue #39)
Can you provide a small demo and tell me how you call python the second time?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi,
Good news. Your pyencrypt is working now.
The problem was that the loader was kept open(in use) by windows the
first time and was not loaded (executed) again.
The solution is, with a little bit of python code, closing the file-handle
of the loader. Now it gets loaded again.
Thanks for your very nice pyencrypt module.
Best regards,
Jacco
Op vr 30 aug 2024 om 18:12 schreef Qi Zhao ***@***.***>:
… Hi! The loader doesn't need to be loaded again. It simply inserte
EncryptFileFinder to sys.meta_path once.
Can you provide more information, such as a small demo?
https://github.com/ZhaoQi99/pyencrypt-pye/blob/32db20cb64dab040d40abfb410518f511b5e290f/pyencrypt/loader.py#L97
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGHFLBGOGIABM2CMN7TLF3ZUCKYRAVCNFSM6AAAAABNMVONH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRRHAYTMMRYGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The problem was that windows was keeping the loader in-use. Due to a few simple lines of code, the loader's file-handle is released, so the loader can start again. |
Hi,
One final question. Since I can use pyencrypt now, when do you think that
you have added the loader name option to pyencrypt?
Best regards,
Jacco
Op wo 25 sep 2024 om 10:14 schreef Jacco Loonstra ***@***.***
…:
Hi,
Good news. Your pyencrypt is working now.
The problem was that the loader was kept open(in use) by windows the
first time and was not loaded (executed) again.
The solution is, with a little bit of python code, closing the file-handle
of the loader. Now it gets loaded again.
Thanks for your very nice pyencrypt module.
Best regards,
Jacco
Op vr 30 aug 2024 om 18:12 schreef Qi Zhao ***@***.***>:
> Hi! The loader doesn't need to be loaded again. It simply inserte
> EncryptFileFinder to sys.meta_path once.
> Can you provide more information, such as a small demo?
>
>
> https://github.com/ZhaoQi99/pyencrypt-pye/blob/32db20cb64dab040d40abfb410518f511b5e290f/pyencrypt/loader.py#L97
>
> —
> Reply to this email directly, view it on GitHub
> <#39 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEGHFLBGOGIABM2CMN7TLF3ZUCKYRAVCNFSM6AAAAABNMVONH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRRHAYTMMRYGQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Sorry, I'm a bit busy recently. I'll let you know when it's added. #40 |
No description provided.
The text was updated successfully, but these errors were encountered: