I've just installed Sublime Text, trying to test out this IDE, I'm trying to put this simple line of code in:
from matplotlib import pyplot as plt
x = range(100)
y = [x**2 for x in x]
plt.plot(x, y)
Just to test it out, and I'm getting an error message:
Traceback (most recent call last):
File "./python3.3/subprocess.py", line 1104, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1050, in run_
return self.run(**args)
File "C:\Users\Or Work\AppData\Roaming\Sublime Text 3\Installed Packages\Conda.sublime-package\commands.py", line 526, in run
File "C:\Users\Or Work\AppData\Roaming\Sublime Text 3\Installed Packages\Conda.sublime-package\commands.py", line 489, in __enter__
File "C:\Users\Or Work\AppData\Roaming\Sublime Text 3\Installed Packages\Conda.sublime-package\commands.py", line 473, in conda_version
File "./python3.3/subprocess.py", line 576, in check_output
File "./python3.3/subprocess.py", line 819, in __init__
File "./python3.3/subprocess.py", line 1110, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
Does anybody knows how to fix this?
P.s I am using Anaconda as my python environment
Thanks for helping!
Related
I run my code in Pythons build in IDLE Shell and it will run no problem. But once it is in virtual studio it then throws this error code.
I have gone into my Python Extension settings and have checked the 'Execute In File Dir' like multiple other posts and fixes say, but it does not seem to resolve my issue.
Error:
Traceback (most recent call last):
File "c:\Users\dpr48\OneDrive\Desktop\Python\FINAL PROJECT\Versions\v1.0.0\Cipher Text -
v1.0.0\CipherText-v1.0.0.py", line 27, in <module>
mainwindow = MainMenu()
File "c:\Users\dpr48\OneDrive\Desktop\Python\FINAL PROJECT\Versions\v1.0.0\Cipher Text -
v1.0.0\CipherText-v1.0.0.py", line 17, in __init__
loadUi('MainMenu.ui', 'r', self)
File "C:\Users\dpr48\AppData\Local\Programs\Python\Python39\lib\site-
packages\PyQt5\uic\__init__.py", line 238, in loadUi
return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
File "C:\Users\dpr48\AppData\Local\Programs\Python\Python39\lib\site-
packages\PyQt5\uic\Loader\loader.py", line 66, in loadUi
File "C:\Users\dpr48\AppData\Local\Programs\Python\Python39\lib\site-
packages\PyQt5\uic\uiparser.py", line 1020, in parse
document = parse(filename)
File "C:\Users\dpr48\AppData\Local\Programs\Python\Python39\lib\xml\etree\ElementTree.py",
line 1229, in parse
tree.parse(source, parser)
File "C:\Users\dpr48\AppData\Local\Programs\Python\Python39\lib\xml\etree\ElementTree.py",
line 569, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'MainMenu.ui'
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
I am trying to install Django CMS on windows. I am using following steps.
C:\Python34\Scripts\pip install djangocms-installer
E:\Projects\example>C:\Python34\Scripts\djangocms -p mysite mysite
But throws following error:
Creating the project
Please wait while I install dependencies
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "c:\python34\lib\site-packages\djangocms_installer\install\__init__.py",
line 95, in requirements
output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)
File "c:\python34\lib\subprocess.py", line 607, in check_output
with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
File "c:\python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "c:\python34\lib\subprocess.py", line 1114, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "c:\python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\djangocms.exe\__main__.py", line 9, in <module>
File "c:\python34\lib\site-packages\djangocms_installer\main.py", line 33, in
execute
verbose=config_data.verbose
File "c:\python34\lib\site-packages\djangocms_installer\install\__init__.py",
line 98, in requirements
logger.error('cmd : %s :%s' % (e.cmd, e.output))
AttributeError: 'FileNotFoundError' object has no attribute 'cmd'
I have searched on it but can't get any solution.
The root cause is this line:
output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)
so put the PATH on the pip executable location and it should work:
set PATH=%PATH%;C:\Python34\Scripts
At first glance, sounds that the package is not very adapted to Windows environment... The double exception is not very nice, and calling pip without any path can be a problem.
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 am trying to execute this simple tshark command through python but I am not able to succeed and I don't understand the error
OS : Windows 7
Python 3.3
Code is
from subprocess import Popen
f = open("C:\\folder2\\test.txt","w")
Popen(["tshark" ,"-r","C:\\folder2\\fvido.pcap","-qz", "io,stat,0"],stdout=f)
and the error I get is
Traceback (most recent call last):
File "C:/Users/pc/Google Drive/Python/tshark1.py", line 6, in <module>
Popen(["tshark" ,"-r","C:\\folder2\\fvido.pcap","-qz", "io,stat,0"],stdout=f)
File "C:\Python33\lib\subprocess.py", line 820, in __init__
restore_signals, start_new_session)
File "C:\Python33\lib\subprocess.py", line 1112, in _execute_child
raise WindowsError(*e.args)
FileNotFoundError: [WinError 2] The system cannot find the file specified