Convert midi to mp3 on Python : Permission Error - mp3

I have an error while using midi2audio and fluisynth library to convert my midi file into audio on Python.
The first error was :
FileNotFoundError: [Errno 2] No such file or directory: 'fluidsynth'
So I went to the subprocess file and i putted the fluidsynth's path because I have already installed it.
Then a new error appeared :
PermissionError: [WinError 5] Accès refusé
I tried to let all the permissions on the file, I runned VSCode as an administrator, I uninstalled and reinstalled fluidsynth and midi2audio both libraries, but always same error.
Is there someone who can help please I really need your help, or at least if yoiu have another way where i don't have to use these two libraries.

Related

Python cannot find file in current directory with PowerShell

I'm trying to set up a new coding environment for myself so that I may learn Python at home on Windows 10. I already installed Python 2.7 and I am able to run it in PowerShell using the python command. However, when I try to get it to run other files (namely HelloWorld.py) it is getting an error
C:\Python27\python.exe: can't open file 'HelloWorld.py': [Errno 2] No such file or directory
I am in the same folder as HelloWorld.py on PowerShell and when I type ls, it appears on the screen. Most of the other questions I've seen on here were resolved by changing the environment variables in System to include python, but I have already done that. I am looking for anything else to try.

Getting this error *** OSError: cannot load library C:\WINDOWS\libzsfc.dll: error 0xc1

I am trying to load a .dll file using python cffi library, but whiele I am trying to load it I am getting following error:-
*** OSError: cannot load library C:\WINDOWS\libzsfc.dll: error 0xc1
I am using this
from cffi import FFI
ffi = FFI()
lib = ffi.dlopen("libzsfc.dll")
but this giving me error, I tried a lot to resolve this, but it remains same, please let me know if anyone faced same issue.
I think you have to first register the dll in windows then load will work fine.
To register the same use command regsvr32 <complete dll path>
Use Regsvr32.exe from the %SystemRoot%\Syswow64 folder. For example, type the following commands to register the DLL: cd \windows\syswow64 regsvr32 c:\filename.dll
Old question, but I just had the same issue. Fixed:
Super easy - reinstall tessaract. Head over to https://github.com/UB-Mannheim/tesseract/wiki. Get their installer. It'll have you uninstall the old version. Worked immediately for me.

I can run my script from idle but not from python.exe?

When I run my script from Idle my program runs perfectly, but when I run the .py file and it spawns a shell # C:\Python27\Python.exe my program fails with the following error:-
IOError: [Errno 13] Permission denied: 'my new file.html'
And the bit of code is:-
f = open("my new file.html", "w")
I have searched for this IOError but the things people are saying don't appear to tie in with what I am doing, which is writing out a file?
If it says "permission denied", that's telling you that you don't have permission to create that file. It isn't lying to you. The first rule of debugging is to always assume the error is telling you the literal truth.
Since you didn't supply a folder in the filename, it's trying to create a file in the current directory. You are probably in a protected folder. If you cd to a folder where you have write permissions, the problem will likely go away.

Save Permissions Python

I am writing a program which tracks pay stub information. It runs fine when running it from source code via the terminal and saves files correctly. In order to distribute it to my client, I compiled the code using PyInstaller to create a 1 file .exe for distribution on Windows 7, and then used Advanced Installer 11.4.1 to create a .msi file for them to install on their platform.
My problem is when running the application after installing the .msi. In the package I distributed a .txt file with the data to load and save to.
When attempting to update the file I distributed the following error occurs:
IOError: [Errno 13] Permission denied: 'testSave.txt'
The code I'm using to try and save the file is:
saving = open(file_name, 'w')
saving.write(data)
Is there a way to tell Python 2.7 to write regardless of privileges, or to make this specific file have basic user privileges when installing?
Thanks.
I modified my program to write to a different location using the system environment and telling Advanced Installer to install the .txt in the Local App Data directory. This allowed me to open the file with 'rw' privileges.
path = os.environ.get('LOCALAPPDATA')
path = path.split('\\')
real_path = ''
print path
for dir in path:
real_path += dir + '/'
print real_path
real_path = os.path.normpath(real_path + 'PayTrakker/testSave.txt')
With Advanced Installer you can set permissions, but you need a licensed edition, i.e. Professional or higher.
You can also build a Professional project in the trial period, to test the permissions support and see if it will work for you.

python: can't open file 'setup.py': [Errno 2] No such file or directory

I am new in the world of programming, as well as to Ubuntu and Python. I am currently trying to access my setup.py module in the terminal. As of right now, the error it gives me is this:
python: can't open file 'setup.py': [Errno 2] No such file or directory
Honestly, I am not sure how to get this module or where to get this module. I have it on Windows, and it seems to work just fine. I have assumed that since python was already installed on Ubuntu, setup.py would already be here. I think I have assumed wrong.
Any help on this issue would be fantastic. If I need to supply more information, please let me know. :)