freeze or obfuscate

2 views
Skip to first unread message

Carmelo Viavattene

unread,
May 9, 2015, 4:23:33 PM5/9/15
to numba...@continuum.io
I have my own program in python for which use cx_freeze to get an executable .EXE windows (needs to obfuscate the code)

I would use numba to speed up the code.
I can not run together with numba cx_freeze.

Or you have to use something else instead of cx_freeze?

Thanks in advance

Victor Gabriel

unread,
May 9, 2015, 4:33:12 PM5/9/15
to numba...@continuum.io

Try Pyinstaller. I have done it and worked like a charm. But I had problems with llvmlite. So I downgraded numba to 0.15.1 and everything is ok.

--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/f79a597a-ce85-4b09-8231-af856b100190%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Carmelo Viavattene

unread,
May 9, 2015, 5:31:25 PM5/9/15
to numba...@continuum.io
my installation is winpython


downgrading not work if i use 
pip uninstall numba

and install numba from "winpython control panel"

Victor Gabriel

unread,
May 9, 2015, 7:15:47 PM5/9/15
to numba...@continuum.io
Try Anaconda python distribution. It is the easiest way to update or downgrade numba versions using the shell command. conda install numba=0.15.1  




--
Dr. Victor Gabriel Leandro Alves, D. Sc.
Clinical Medical Physicist - Quality Audits
Instituto Nacional de Câncer - Brazil   

Carmelo Viavattene

unread,
May 10, 2015, 11:43:31 AM5/10/15
to numba...@continuum.io
In Anaconda, numba work if downgraded, also with cx_freeze

Then, the problem is numba >= 0.15.1, or llvmlite 

I work with pyside and cx_freeze  compile it very well.
pyinstaller not compile the Qt splash screen with pyside

Then. i think my problem is solved, with downgrade

Actually, I started python with anaconda, and in August 2014 and cx_freeze numba worked, except when I made updates through conda.

then I had the problem that in anaconda installing pyside, PySide-uic is not working, and I had abandoned him, beginning to use winpython where PySide-uic works, although I find it slower than anaconda, and I used cx_freeze only PySide and had abandoned the development of the more complex procedures from the point of view of the calculation, which serves for the acceleration of numba, so do not use it.

I just tried using numba, it worked more in winpython neither in nor anaconda

Thanks to the advice dl dr. Victor Gabriel, I understand the problem: it was necessary not to go ahead with the versions of numba

At this point, return to Anaconda, without upgade especially numba, and only for use winpython PySide-uic, this is only for the interfaces

Carmelo Viavattene

unread,
May 10, 2015, 1:08:36 PM5/10/15
to numba...@continuum.io

At this point, i return to Anaconda, without upgrade especially numba, and i use winpython only for PySide-uic (this is only for the interfaces).

Thank you.

I hope numba can solve in a upgrade this problem.

Ing. Carmelo Viavattene
ENNA

Victor Gabriel

unread,
May 10, 2015, 10:12:38 PM5/10/15
to numba...@continuum.io
I also use PySide-uic from Anaconda, but I installed using the command:  conda install pyside

If you are on windows the script is located in:

Lib\site-packages\PySide\scripts\uic.py

It is the same as pyside-uic.

Then, you do not need winpython anymore.  :)





--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.

Carmelo Viavattene

unread,
May 11, 2015, 1:33:07 AM5/11/15
to numba...@continuum.io
I found uic.py

then, i must compile uic.py in PySide-uic.exe ?

thank you

ing. Carmelo Viavattene
Enna
Italy

Victor Gabriel

unread,
May 11, 2015, 8:24:52 AM5/11/15
to numba...@continuum.io

No need to compile. You can use it the same way Python scrips.

Carmelo Viavattene

unread,
May 11, 2015, 1:39:39 PM5/11/15
to numba...@continuum.io
Ok. it work using as a script.

So, I dropped winpython, and now I'm back on Anaconda.
I would like to work with the 32-bit version to give the option to install the software on 32-bit systems.

My programs were all developed with python 2.7, and I wanted to try using python 3.4.
First with winpython, as you install in portable mode in a folder windows, and I noticed that everything worked perfectly.

I installed version 2.2 with Python 3.4.
I think that you work with anaconda and python 2.7, because I noticed that you do not install PySide by:
conda install PySide

However I have to use pip to install cx_freeze, by:
pip install cx_freeze
so I installed PySide by:
pip install PySide

I must say that now everything works.

O you advise me not to switch to python 2.7 python 3.4?

Thank You

ing. Carmelo Viavattene
Enna - Italy

Victor Gabriel

unread,
May 11, 2015, 1:55:02 PM5/11/15
to numba...@continuum.io
Great that you could compile your code using numba. That is an amazing package.  

I think conda command is case sensitive, so I also installed using the command conda install pyside

You can create a Python 3 environment to test..

Creating Python 3.4 or Python 2.6 environments


But most of the "scientific python packages" are not Python3 ready, even though I have had some "unicode nightmares" I keep coding in Pyhon 2.7.




Carmelo Viavattene

unread,
May 11, 2015, 2:24:41 PM5/11/15
to numba...@continuum.io

But most of the "scientific python packages" are not Python3 ready, even though I have had some "unicode nightmares" I keep coding in Pyhon 2.7.


Ok. I use Python 2.7, i want "scientific python packages"

Then, re-install anaconda 2.2 python 2.7 32 bit

Dustin Moore

unread,
May 12, 2015, 9:38:22 AM5/12/15
to numba...@continuum.io


On Monday, May 11, 2015 at 2:24:41 PM UTC-4, Carmelo Viavattene wrote:

But most of the "scientific python packages" are not Python3 ready, even though I have had some "unicode nightmares" I keep coding in Pyhon 2.7.


What packages do you need to use that are not Python 3 ready? All of the scipy/numpy/pandas and so on is fine in Python 3.

Victor Gabriel

unread,
May 12, 2015, 9:43:28 AM5/12/15
to numba...@continuum.io

Opencv and pydicom.

--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.

Antoine Pitrou

unread,
May 12, 2015, 10:32:03 AM5/12/15
to numba...@continuum.io

Le 09/05/2015 22:33, Victor Gabriel a écrit :
> Try Pyinstaller. I have done it and worked like a charm. But I had
> problems with llvmlite. So I downgraded numba to 0.15.1 and everything
> is ok.

llvmlite uses a specific shared library that's probably not autodetected
by PyInstaller. You can probably add it manually to the bundle. It
should be named llvmlite/binding/libllvmlite.so or
llvmlite/binding/llvmlite.dll, depending on your OS.

Regards

Antoine.

Victor Gabriel

unread,
May 12, 2015, 4:09:24 PM5/12/15
to numba...@continuum.io
Antonie,

I installed numba 0.18.2 to test your tip.

I added manually those folders and file llvmlite/binding/llvmlite.dll to the bundle. Then It worked!

I will test libllvmlite.so on my linux enviroment .

Thanks!

Victor







--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.

Carmelo Viavattene

unread,
May 12, 2015, 4:17:00 PM5/12/15
to numba...@continuum.io
Can you tell which instructions you used to incorporate the .dll, so I try if it works with cx_freeze?

Thanks
Carmelo

Victor Gabriel

unread,
May 12, 2015, 4:22:31 PM5/12/15
to numba...@continuum.io
I created on the root folder of my app.

llvmlite  ( folder)

binding ( folder inside llvmlite folder)

put the file  "llvmlite.dll"  inside the binding folder.

That is it.



 


Carmelo Viavattene

unread,
May 12, 2015, 4:44:58 PM5/12/15
to numba...@continuum.io
To be honest:
I am new to the Python language, in fact I play for a few months a little seriously.
about 25 years ago I wrote in c programs for a software house, then I switched to C ++, and now it came back the passion for programming.

I programmed for matrix calculations and FEM, and it seems to me that everything that I will need to reuse some old piece of code is already present in SciPy and numpy.
I discovered that my code that I learned PySide also works with python 3, and I was to go directly to Python 3.
I do not understand why anaconda has support through conda PySide for version 3.4, because their PySide package is for version 3.3.
For use in anaconda PySide 3.4 must be installed by pip.

I can think of moving to Python 3.4 as they are in fact new to the language, and so it seems normal to go directly to version 3, why not use libraries that are not brought from 2 to 3, I do not have to change the style of programming 2 to adapt it to 3.

Dustin seems to encourage me to do so.

I do try to get on with python 3, and I hope not regret it in the future

Thanks, Carmelo

Carmelo Viavattene

unread,
May 12, 2015, 5:18:13 PM5/12/15
to numba...@continuum.io
Not work with cx_freeze.

I return back:

conda install numba=0.15.1

Sorry.

Carmelo Viavattene

unread,
May 14, 2015, 5:59:32 PM5/14/15
to numba...@continuum.io
After seeing that:
- Libraries python brought to 3 are only less than 10,000 to more than 60,000 existing;
- Support for the 2 will arrive until 2020;
I decided that to avoid problems of lack of libraries, for now rest with python 2.7, trying to leave the code for 3.4 compatible

ing. Carmelo Viavattene

mauro herrera

unread,
Sep 24, 2015, 5:47:54 PM9/24/15
to Numba Public Discussion - Public
Hi, 

i am trying generate a .exe file that include numba and numbapro modules, but when i execute the generate .exe file return the errors in the image.

I use the acdemic license.

Best regards!!!

error.png

Gaëtan de Menten

unread,
Sep 25, 2015, 2:52:51 AM9/25/15
to numba...@continuum.io
This is probably: https://github.com/numba/llvmlite/pull/96

Hope it helps,
Gaëtan
> --
> You received this message because you are subscribed to the Google Groups
> "Numba Public Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to numba-users...@continuum.io.
> To post to this group, send email to numba...@continuum.io.
> To view this discussion on the web visit
> https://groups.google.com/a/continuum.io/d/msgid/numba-users/a4666044-963d-49f5-8ec0-f8d2ea175984%40continuum.io.

mauro herrera

unread,
Sep 25, 2015, 10:18:57 AM9/25/15
to Numba Public Discussion - Public
Yes, Gaëtan de Menten.... The solution is in the github link.

I'm really grateful with you, i had a good time searching for the solution.

Best regards!!!!
Reply all
Reply to author
Forward
0 new messages