-
Notifications
You must be signed in to change notification settings - Fork 278
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
Advanced mode 1 Failing with Pyenv environment on Pyarmor(6.2.1) #243
Comments
Does it work just obfuscating one simple script with advanced 1? It should work in Ubuntu /Python 3.6. |
I tried it on a single file and the issue persists. |
Could you upload the file |
Here is the download link for the same. Just for additional information I am using pyenv and instead of a clean installation, I have upgraded to Ubuntu 20.04 from 18.04 |
Since you mentioned the involvemenet of libpython for the .so files. I think this could very well be the case of pyenv not being able to link the libpython library as mentioned in the issue. I will try enabling shared libraries and then give it a go. |
Tried it , but the problem still persists. |
Ok, I tried to create a virtualenv which is using the python from the root folders instead of pyenv's version. And in such a case, I am able to run the tool perfectly. It seems that when I using using a python installed by pyenv, that the library stops working. Is there a recommended way to use pyarmor with pyenv? |
I know a little about pyenv. But if pyenv don't use CPython library, it's difficult to work with Pyarmor. If pyenv can be configured with CPython python library, it should be OK. |
I have tried using |
What's the error message to run pyarmor? Or it's building OK, only advanced mode 1 failed as before? |
Command for build
Build happens successfully. OutputOn running
Tried this with both versions of python installs on pyenv
|
It seems that the python library used by pyenv isn't patched by pyarmor correctly. What the output with extra "-d" to run the obfuscated foo.py?
If it complains of the library patched failed, find the dynamic library used by pyenv, and upload it to the temporary site. |
This is the output :
However, I have double checked that I have used advanced mode 1 (not 2) |
The key problem is patch failed. I think pyenv uses different python dynamic library from the host python. You can start python interpreter in pyenv and check the dynamic libraries used by this process, I need check it. |
Since I am not explicitly setting the LD_LIBRARY_PATH, I presume the libraries would be picked from the sys.path which :
Do you want me to upload the |
No. What I care about only dynamic library. You can got it by this way:
Just upload this |
Thanks for the detailed instruction. Link to the .so file |
@e0lithic Could you upload it again? I try to download it just now, but it's gone. |
I have downloaded this one, It's OK, thanks. |
@jondy Do you see a fix/workaround in near time frame for this. Or should I just temporary remove pyenv from my poetry env to make a couple of releases needed for my team. |
@e0lithic I'll check it and feedback you tomorrow. |
Tried it . Got the following result :
|
Try this one |
Here is the output:
|
Could you upload this file |
Heres the link |
Try this one Hope it works |
Got the following error now :
|
Try this one |
It worked. 👍 |
Nice, it'll be released with next version v6.2.2 |
Closing the issue as this has been fixed in the 6.2.2 release. Thanks for the great support. I will also update the issue title to better reflect the issue. |
Hi Again,
Environment
Python - 3.6.9
OS - Ubuntu 20.04
Pyarmor - 6.2.0
Project structure
mypkg
├── bar.py
├── foo.py
└── init.py
Configuration files
I am using the child project structure to demonstrate a use-case for a large package. Here we are just obfuscating everything else with restrict mode 4 and using restrict mode 1 for
__init__.py
. As is recommended for a package.Command :
The build completes successfully.
Behaviour/Expectation
If we try to import the obfuscated mykg then we get the following error
If we just turn
advanced_mode
0 in both configuration files and rerun the build. I am able to import the package.I read the documentation but the python 3.6 limitation was only mentioned for advanced_mode 2 / a.k.a super mode. Is the support for advanced mode 1 on python 3.6 also depreciated? Kindly let me know if I am missing something.
Thanks
The text was updated successfully, but these errors were encountered: