The PyInstaller problem. Detecting exe as a virus - exe

I have created an exe using py installer from my code in python. I checked on VirusTotal is it safe. It wasn't. I have made some reserch and eventually i found what is a problem. It depends on the pyinstaller. My code isn't dangerous or destructive. How can i fix this problem or how to make an exe without "virus".
Thank you in advance

Related

How to install WinGHCi?

I used to learn Haskell before I uninstalled everything. Now, I downloaded the Haskell platform but it seems there's no WinGHCi. Any suggestion please to solve the issue?
I tried to install it manually but there is no .exe file.

PyInstaller executable on Windows not working because of PortAudio library issues (OSError)

I'm trying to build a .exe on Windows from my Python 3.7 application using PyInstaller. The build appears to run smoothly and shows no errors; however, executing the file on the Windows command prompt results in this awful error:
OSError: PortAudio library not found
I've done some research about this problem and found some info, but still couldn't overcome it. My app uses the sounddevice library, which depends on PortAudio library. PortAudio is installed, since the app works perfectly when I run it directly using Python; the problem is, clearly, that PyInstaller tracks the dependencies in some different way and is not able to find it and link it to the build.
This 'different way' is, actually, calling the 'find_library' function from 'ctypes.util' Python library to find the PortAudio library on the system. So, I ran the following on Python and confirmed it is not able to find the libary.
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: > Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
from ctypes.util import find_library
a = find_library('portaudio')
print(a)
None
So far, I've tried several solutions. First, I downloaded and compiled the last PortAudio version manually. Didn't work. Then, I tried using Anaconda instead of the official Python distribution; as you may know, Anaconda's package manager 'conda' can deal with C libraries like PortAudio. So I installed it on my Anaconda's virtual environment and tried to build my app in there. Didn't work either. I also tried adding PortAudio directory to Windows PATH variable, but it also failed. I'm kinda lost. The only idea I have yet to try is building it on Linux using Wine, but I suspect there might be a way to get it working on Windows.
Any ideas?
I managed to solve it myself. I'll post the answer, it may be useful to somebody.
What I thought was right. ctypes checks the folders defined in Windows PATH environment variable and searches them for libraries. Thing is, on Linux the system uses some kind of alias, so when
from ctypes.util import find_library
find_library('portaudio')
it returns the correct portaudio library. But on Windows, only the file names are checked. So, you have to make sure this two conditions are met:
The directory containing the PortAudio DLLs is in your PATH environment variable.
The DLL filename (without the extension) must be exactly 'portaudio'.
About the DLLs, if you were using sounddevice in your Python app, you should be able to find them here:
\your\path\to\python\Lib\site-packages_sounddevice_data\portaudio-binaries
The file is named 'libportaudio64bit.dll', so simply adding that directory to PATH won't do the trick. To overcome this, I just copied the dll into another directory, renamed it as 'portaudio.dll' and added that directory to PATH. Worked like magic.
If you're not using sounddevice, you can also download those same precompiled DLLs from here:
https://github.com/spatialaudio/portaudio-binaries
That's all. Hope it helps!
As the selected answer didn't work for me, because I'm using virtualenv, I put my working solution here.
For me, the working solution is to add _sounddevice_data folder where the .exe file is located then making a portaudio-binaries folder in it and finally putting libportaudio64bit.dll in the recently created folder.
Hope it helps!

"No module named wordcloud" after successful installation

After searching everywhere on here I found some solutions to my problem. At first, the error was that I needed Visual C++ 14.0 and that I could get it from a link that didn't work. So, I downloaded Visual C++ Build Tools and got Visual C++ 14.0.23026. That did not solve the problem.
I did some more searching and found that I could install it using wheel. So, I got wheel and got the .whl file from here as shown in the comments of this
post, making sure to get the correct version for my python version (3.6). Running python -m pip install wordcloud-1.5.0-cp36-cp36m-win32.whl worked, it seemed.
However, after restarting Pycharm, the IDE I use to run python files, it still didn't import it correctly. ModuleNotFoundError: No module named 'wordcloud'.
What am I missing here? Thanks!
EDIT: It works outside of Pycharm (just double clicking my python file), but I'd still like it to work in Pycharm.
I have the same problem and I've solved it.
When you create a project, you should choose 'inherit global site-packages
Or
You can use the terminal in the Pycharm to install the wordcloud.
You can also install wordcloud by File->Settings->Project:your project name->Project interpreter.

How can I make an executable for python3 if I am using PyQt5?

I tried to make the executable with cxFreeze, but it sends me the error that it does not find the module called Codecs, could someone help me to create the executable with either cxFreeze or with any other tool?
Well without further details we can't help much. However the codecs problem is common in cx_Freeze and this was fixed in the latest version. You should update cx_Freeze to version 5.1 and your problem should be fixed.
Source: https://github.com/anthony-tuininga/cx_Freeze/issues/325

Error installing Pygame / Python 3.4.1

I'm trying to install Pygame and it returns me the following error "Python version 3.4 required which was not found in the registry". However I already have the Python 3.4.1 installed on my system. Does anyone know how to solve that problem?
I've been using Windows 8.1
Thanks in advance.
Are you using a 64-bit operating system? Try using the 32-bit installer.
Tips I can provide:
Add Python to your Path file in the Advanced settings of your Environmental Variables (just search for it in the control panel)
Something may have gone wrong with the download of Python, so re-install it. Also don't download the 64-bit version, just download the 32-bit version from the main pygame website
Once that's sorted out, transfer the entire Pygame file to the site packages in the Python directory and open up the pygame file and go to this directory in command prompt. Finally, run the Pygame setup from the command prompt which should be something like:
python setup.py
But this will only work if the pygame setup file is called setup.py (it's been a while since I downloaded it), you added Python to the Path file and you're currently in the correct directory in command prompt.
To test if it worked try importing pygame and see if you got an error or not.

Resources