Non-zero exit code (1):
Traceback (most recent call last):
File "/snap/pycharm-community/315/plugins/python-ce/helpers/pydev/setup_cython.py", line 242, in main()
File "/snap/pycharm-community/315/plugins/python-ce/helpers/pydev/setup_cython.py", line 233, in main with FrameEvalModuleBuildContext():
File "/snap/pycharm-community/315/plugins/python-ce/helpers/pydev/setup_cython.py", line 187, in __enter__ shutil.copy(compatible_c, self._c_file)
File "/usr/lib/python3.9/shutil.py", line 427, in copy copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.9/shutil.py", line 266, in copyfile with
open(dst, 'wb') as fdst: OSError: [Errno 30] Read-only file system: '/snap/pycharm-community/315/plugins/python-ce/helpers/pydev/_pydevd_frame_eval/pydevd_frame_evaluator.c'
I did as written here, but it doesn't work yet.
Please tell me what else can be done.
Related
I made a python app using pygame and pygame-gui library. I've been getting this error when I try to run the python app that I've converted into an exe file. I used this command: pyinstaller App-Name.py --hidden-import=data.jsonfile --onefile --noconsole for creating the executable. And when I try to run it, it gives me this error:
Failed to execute script 'App-Name.py' due to unhandled exception: [Errno 2] No such file or directory: 'C:\Users\Acer\AppData\Local\Temp\_MEI164642\data\jsonfile\theme-1.json'
Traceback (most recent call last):
File "App-Name.py", line 508, in <module>
File "App-Name.py", line 37, in __init__
File "pygame_gui\ui_manager.py", line 68, in __init__
File "pygame_gui\core\ui_appearance_theme.py", line 624, in load_theme
File "importlib\resources.py", line 103, in read_text
File "importlib\resources.py", line 82, in open_text
File "importlib\resources.py", line 46, in open_binary
File "PyInstaller\loader\pyimod03_importers.py", line 542, in open_resource
File "pathlib.py", line 1117, in open
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Acer\\AppData\\Local\\Temp\\_MEI164642\\data\\jsonfile\\theme-1.json'
I've tried looking for the answer anywhere but nothing works so far. Any help would be appreciated!
try reinstalling pyinstaller or try other modules such as cx_freeze
How to overcome from the permission error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Ramesh\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 41, in _playsoundWin
copy(sound, tempPath)
File "C:\Users\Ramesh\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 418, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "C:\Users\Ramesh\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'F:\\Python course\\1. Chapter 1'
Can you post the code? If you do it I will be able to check the error more clearly and answer your question nad you also check if there are any errors
I recently have packaged a python app using the pyinstaller --onefile command. It succesfully makes a executable file that launches fine. I can use pretty much almost all the functions in my script with no problem, except one. When I call a function of another python file (which is in my app folder), I get this error:
Traceback (most recent call last):
File "socketserver.py", line 647, in process_request_thread
File "socketserver.py", line 357, in finish_request
File "socketserver.py", line 717, in __init__
File "http/server.py", line 426, in handle
File "http/server.py", line 414, in handle_one_request
File "CaptchaHarvester/harvester/server/__init__.py", line 134, in do_GET
File "CaptchaHarvester/harvester/server/__init__.py", line 178, in handel_request
File "CaptchaHarvester/harvester/server/__init__.py", line 85, in _load_template
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/rl/rmr5s0ld22j0h_z15m90v0c80000gr/T/_MEIBVnHEv/harvester/server/templates/ga.chunk.html'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 54955)
Traceback (most recent call last):
File "socketserver.py", line 647, in process_request_thread
File "socketserver.py", line 357, in finish_request
File "socketserver.py", line 717, in __init__
File "http/server.py", line 426, in handle
File "http/server.py", line 414, in handle_one_request
File "CaptchaHarvester/harvester/server/__init__.py", line 122, in do_GET
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/rl/rmr5s0ld22j0h_z15m90v0c80000gr/T/_MEIBVnHEv/harvester/server/icon.png'
The problem seems to be that pyinstaller cant properly find the files(icon.png and ga.hunk.html). These files are in a folder that is in the same folder as my main.py file. I was wondering how I can make pyinstaller find these files succesfully? I have tried to add to the datas class in the .spec file, but I still get the error. This is what that line looks like:datas=[('/Users/A/Desktop/ss/CaptchaHarvester/harvester/server/icon.png','/Users/A/Desktop/ss/CaptchaHarvester/harvester/server')],
Please let me know if I am doing something wrong or if yall have any ideas on how to resolve it.
I am on macosx catalina and python 3.7 if that is any help.
Thanks!
You can use arguments in command prompt to ensure the correct filesare found by pyinstaller; --add-data "path_to_file:path_in_executable in directory" an example would be
pyinstaller --add-data "icon.png;." --onefile socketserver.py
here icon.png is in the same directoy of socketserver.py and is copied to the root directory of the executable (the . signifies root directory)
After I reinstalled Python to move it from an AppData folder to Program Files, it looks like the shelve module is no longer working and I receive the error below when I call upon shelve.open().
Please help!
>>> import shelve
>>> myShelf = shelve.open('data')
Traceback (most recent call last):
File "C:\Program Files\Python\lib\dbm\dumb.py", line 81, in _create
f = _io.open(self._datfile, 'r', encoding="Latin-1")
FileNotFoundError: [Errno 2] No such file or directory: 'data.dat'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
myShelf = shelve.open('data')
File "C:\Program Files\Python\lib\shelve.py", line 243, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "C:\Program Files\Python\lib\shelve.py", line 227, in __init__
Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
File "C:\Program Files\Python\lib\dbm\__init__.py", line 94, in open
return mod.open(file, flag, mode)
File "C:\Program Files\Python\lib\dbm\dumb.py", line 303, in open
return _Database(file, mode, flag=flag)
File "C:\Program Files\Python\lib\dbm\dumb.py", line 69, in __init__
self._create(flag)
File "C:\Program Files\Python\lib\dbm\dumb.py", line 83, in _create
with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
PermissionError: [Errno 13] Permission denied: 'data.dat'
>>>
The error "FileNotFoundError: [Errno 2] No such file or directory: 'data.dat'" shows you, it can not find the data.dat, please check the file location.
I had this problem using Windows 10. I solved the issue by changing the working directory to a folder under my profile.
os.chdir('C:\\Users\\Nat\\Documents\\Python\\Project 1')
I presume I didn't have permission to write a file 'Program Files'.
I'm trying to set up django-nonrel into a new virtualenv, but am getting an error saying: OSError: [Errno 2] No such file or directory.
I can't tell from the error log exactly which file or directory is missing. Please could anyone suggest what might be going wrong?
The bitbucket file seems to be present:
(nonrel)delirium:nonrel anna$ pip install hg+https://bitbucket.org/wkornewald/django-nonrel
Downloading/unpacking hg+https://bitbucket.org/wkornewald/django-nonrel
Cloning hg https://bitbucket.org/wkornewald/django-nonrel to /var/folders/q5/_0_8qh59147_0vmr8tm1_mq80000gn/T/pip-3Trv56-build
Error [Errno 2] No such file or directory while executing command /usr/local/bin/hg clone --noupdate -q https://bitbucket.org/wkornewald/django-nonrel /var/folders/q5/_0_8qh59147_0vmr8tm1_mq80000gn/T/pip-3Trv56-build
Exception:
Traceback (most recent call last):
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
status = self.run(options, args)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 245, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 985, in prepare_files
self.unpack_url(url, location, self.is_download)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1103, in unpack_url
return unpack_vcs_link(link, loc, only_download)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 294, in unpack_vcs_link
vcs_backend.unpack(location)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/vcs/__init__.py", line 233, in unpack
self.obtain(location)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/vcs/mercurial.py", line 81, in obtain
call_subprocess([self.cmd, 'clone', '--noupdate', '-q', url, dest])
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 221, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Storing complete log in /Users/anna/.pip/pip.log
What is going wrong?
I'd recommend getting the latest version from github
https://github.com/django-nonrel/django-nonrel
You'd wanna use git to download it rather than pip.