On my professionnel computer, i've managed to install on a specific open folder the ananconda sw and the cx_freeze libs.
However when I want to build a python files in another folder here :
Do you have any idea what is the problem? Limitation of the IT departement in any proxy? Bad installation of cx_freeze? bas usage of it?
error compilation
Related
I'm trying to create a CPack-based MacOS installer for an audio plugin project. The default location of MacOS audio plugin is in the /Library/Audio/PlugIns/ folder which needs root rights to be written to.
AFAIK CPack takes the destination path for the installed artifacts from the path specified in the CMake INSTALL command, so my CMakeLists.txt looks like that:
# CPack takes these paths as the locations where the plugins should be installed in the end
install (TARGETS MYPLUGIN_VST3 LIBRARY DESTINATION /Library/Audio/Plug-Ins/VST3 COMPONENT VST3)
install (TARGETS MYPLUGIN_AU LIBRARY DESTINATION /Library/Audio/Plug-Ins/Components COMPONENT AU)
# This makes sure that only the two components and nothing else is part of our installer
SET (CPACK_COMPONENTS_ALL VST3 AU)
# We want to use the native Apple GUI installer
SET (CPACK_GENERATOR productbuild)
Now, when I call cpack to build the installer it fails because of a permission issue as it installs the plugins as a first step before building the installer. The only solution I found was running cpack with root rights to let it write to these locations during the install step which seems like bad practice to me and might be even worse when trying to run this on a build server in future. As I don't need the install step but only want the resulting installer, I wonder if there is any way to avoid the install step and let CPack grab the files to wrap into the installer directly from the binary directory where they were placed after build. Didn't find anything regarding that in the documentations, but I'm just starting with CMake and CPack, so I might overlook something obvious here
So, I created a python program. Converted to exe using Py2Exe, and tried with PyInstaller and cx_freeze as well. All these trigger the program to be detected as virus by avast, avg, and others on virustotal and on my local machine.
I tried changing to a Hello World script to see if the problem is there but the results are exactly the same.
My question is, what is triggering this detection? The way in which the .exe is created?
If so, are there any other alternatives to Py2exe, Pyinstaller, cx_freeze?
You can try nuitka.
pip install -U nuitka
Example:
nuitka --recurse-all --icon=app.ico --portable helloworld.py
Website:
http://nuitka.net/
Maybe you need to install Visual C++ 2015 Build Tools for compile.
http://landinghub.visualstudio.com/visual-cpp-build-tools
If you download Nuitka package, you will find a Trojan files in the folder.
If you use this library, you will create a exe file with a Trojan embedded in the exe file.
It converts files much faster than other similar libraries with no errors.
I'm trying to get a Python 3.4 interpreter into my app without to distribute python framework.
I'm linking with the libpython3.4.a (which appear to have dependency on Python.framework/versions/3.4/Python), but as guessed, it need python framework.
Does someone experienced this issue ?
Logically,i should be able to link statically (real static) and just distribute the python34.zip modules, right ?
Thanks for you help.
EDIT:
Finally i downloaded the Python 3.4 sources and build a static version.
Now i don't have dependency issue.
So i include the python3.4.zip near my executable.
But now, when starting the application i have this error:
"Fatal Python error: Py_Initialize: unable to load the file system codec"
So, i set Py_SetProgramName() to my binary and Py_SetPath(zippath) before the Py_Initialize().
But i still have the "ImportError: No module named 'encodings'" issue.
I also have tested with a simple folder instead of a zip.
I tried to install cx_freeze on my computer (windows) with an MSI, but the installation kept failing saying something like "one or more needed files could not be found." Because installing from a prebuilt binary wasn't an option, I decided to build cx_freeze from source.
I downloaded the .tar.bz and extracted until I got to the actual folder containing the setup.py. I cded into the directory, and ran the command
python setup.py install
A cmd windows came up and printed out a lot of text along the lines of "adding base module named...",then printed out
running install
running build
running build_py
However, the install then failed with the error
error: package directory 'cx_freeze' does not exist
I have no idea how to solve this. If someone could give me working instructions on how to install cx_freeze that would be great
BTW, I'm on python 3.3
After struggling around for 1 and a half hour I found the solution!
I followed these steps to compile CX_Freeze from source for Python 3.3:
install visual studio 2010 c++ (only 2010 works!)
Download the latest version of CX_Freeze from BitBucket. You need this one, the version on the main page of CX_Freeze misses one file! https://bitbucket.org/anthony_tuininga/cx_freeze
Extract the file
Launch cmd and cd to the directory of the extracted folder. (This will avoid your problem)
(optional: path to python.exe) setup.py install
Done!
During this I faced one major issue. There where some problems with mt.exe and it failed with exit status 31.
The solution is to go to you python and edit msvc9compiler.py in Lib/distutils.
Search for the following line:
ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
replace it by:
ld_args.append(‘/MANIFEST’)
sources which helped me:
http://fuyun.org/2009/12/install-mysql-for-python-on-windows/
http://grokbase.com/t/python/tutor/03be598tkx/how-to-install-new-package#20031115zd5eiqq27cbflktokjw4esr4g4
I am trying to install an external dependency into Python for TideSDK. The current module I am trying to install is redis-py.
To install it I tried the following steps:
Open Command Prompt in regular administrative mode
Change directory to the downloaded module of redis-py
Provide the path to the python module used by TideSDK followed by the standard compile and install from source command prompt. The command I used: "C:\Program Files (x8
6)\TideSDK Developer\modules\python\1.3.1-beta\python.exe" setup.py install
The setup looked very promising. The redis-py module with egg file is confirmed to be installed by both the installer with exited with no errors and with a visual check on the directory.
So what gives? The correct files are installed in Lib/site-packages. TideSDK gives me ImportError: No module named redis. Any suggestions?
I solved it for another module: simplejson.
I guess the workaround should work for any module of this kind.
BTW, simplejson may be used to support json, as the actual version (TideSDK 1.3.1-beta) comes with Python 2.5 which doesn't support the standard json module, it comes in Python 2.6 (or higher).
First, the path you are using is for "TideSDK Developer", that's the program to launch and build apps. It happens that "TideSDK Developer" is built using TideSDK, so the structure is the same.
C:\Program Files (x8 6)\TideSDK
Developer\modules\python\1.3.1-beta\python.exe
The path that TideSDK actually uses to launch and compile apps is inside "C:\ProgramData"
In my case, it's:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\python.exe
So, this is what I did, I ran:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\python.exe setup.py install
That "installs" the module, but installs it inside "site-packages". So, when I launched the app I got the same error ("no module named simplejson"), I then copied the module from inside "site-packages" to outside.
I copied from:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\Lib\site-packages\simplejson
to:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\Lib\simplejson
And that's it. That worked for me.
In summary: Go to ProgramData, install with python and copy the folder installed inside site-packages.