I have faced error while opening the Thonny Ide.
ERROR: Internal error
Traceback (most recent call last):
File "C:\Program Files (x86)\Thonny\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 356, in cmd_stop_restart
self.restart_backend(True)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 458, in restart_backend
self._proxy = backend_class(clean)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 1036, in __init__
CPythonProxy.__init__(self, executable)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 624, in __init__
self._start_new_process()
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 764, in _start_new_process
debug("Starting the backend: %s %s", cmd_line, get_workbench().get_cwd())
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\workbench.py", line 1252, in get_cwd
return normpath_with_actual_case(os.path.expanduser("~"))
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\common.py", line 212, in normpath_with_actual_case
assert os.path.isabs(name)
AssertionError
OS: Windows 7 64-bit
Python: Python 3.7(94bit)
Thonny:3.1.2
Open %APPDATA%\Thonny\configuration.ini (or wherever your IDE config is)
Scroll down to [run] section and check parameter working_directory.
Make sure something meaningful is set there, e.g. C:\ should do the trick (no double backslahes, quotes, etc..).
I had the same issue. For some reason only word lib was there. Modifying this parameter to a proper filesystem path fixed it in my case.
Something has corrupted the current instance of your Thonny installation at the backend.
You will first need to completely uninstall Thonny and then remove any imprints of Thonny from your computer's registry.
Then reinstall Thonny and open Thonny IDE.
Hope this helps.
I also faced this issue, for me it was due to Antivirus, just disabling Auto Containment fixed the issue, Hope this helps.
Related
I recently came across this error while using "pip install" with python version 3.10 and pip version 22.3.1:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\req_command.py", line 247, in wrapper
return func(self, options, args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\commands\download.py", line 103, in run
build_tracker = self.enter_context(get_build_tracker())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\command_context.py", line 27, in enter_context
return self._main_context.enter_context(context_provider)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 492, in enter_context
result = _cm_type.__enter__(cm)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 135, in __enter__
return next(self.gen)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\operations\build\build_tracker.py", line 46, in get_build_tracker
root = ctx.enter_context(TempDirectory(kind="build-tracker")).path
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\utils\temp_dir.py", line 125, in __init__
path = self._create(kind)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\utils\temp_dir.py", line 164, in _create
path = os.path.realpath(tempfile.mkdtemp(prefix=f"pip-{kind}-"))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tempfile.py", line 357, in mkdtemp
prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tempfile.py", line 126, in _sanitize_params
dir = gettempdir()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tempfile.py", line 299, in gettempdir
return _os.fsdecode(_gettempdir())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tempfile.py", line 292, in _gettempdir
tempdir = _get_default_tempdir()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tempfile.py", line 223, in _get_default_tempdir
raise FileNotFoundError(_errno.ENOENT,
FileNotFoundError: [Errno 2] No usable temporary directory found in ['C:\\Users\\leon\\AppData\\Local\\Temp', 'C:\\Users\\leon\\AppData\\Local\\Temp', 'C:\\Users\\leon\\AppData\\Local\\Temp', 'C:\\windows\\Temp', 'c:\\temp', 'c:\\tmp', '\\temp', '\\tmp', 'C:\\Users\\leon']
WARNING: There was an error checking the latest version of pip.
Before that there was a acess error with the console history which I had been able to solve, but no mater what I try this error always comes up. I also tried reinstalling python 3.10 and I also tried it with python 3.11 but it's always this error when using pip install. There also was this weird error in Pycharm where it couldn't set upt the virtual env but this is also fixed aready.
Thanks in advance.
If you read the code for tempfile.py shown in the trace and particulary: _get_default_tempdir() implementation, you will see that the code does following:
get the list of all possible temp directory locations (eg, this list is shown in the actual Exception)
Iterate the list it got
Tries to write a small random file into a given directory
If that works, return the directory name to be used as temporary path.
If not, iterate the rest of the list from 2.
If the list gets iterated to the end, you will get the exception you are now seeing.
So, essentially, your pip install will try to write to bunch of different temporary locations but each one of those fail.
This is most likely that each of those locations, your user does not have write access or your filesystem is full, or there could be some AV tool that blocks writes to these locations or some other reason.
Do check these directories:
C:\Users\leon\AppData\Local\Temp
C:\Users\leon\AppData\Local\Temp
C:\Users\leon\AppData\Local\Temp
C:\windows\Temp
c:\temp
c:\tmp
C:\Users\leon
OR before you run pip, set TMP and TEMP environment variables to point to location where you can write to.
I am having an issue with a program, which uses panda3d. It works perfectly when executed as a pythonscript, but the version, which is compiled (or rather packaged) by PyInstaller throws the exception below.
:display(warning): Unable to load libpandagl.so: No error.
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
File "Shipsim3d_1-1.py", line 930, in <module>
File "Shipsim3d_1-1.py", line 23, in __init__
File "direct/showbase/ShowBase.py", line 339, in __init__
File "direct/showbase/ShowBase.py", line 1024, in openDefaultWindow
File "direct/showbase/ShowBase.py", line 1059, in openMainWindow
File "direct/showbase/ShowBase.py", line 769, in openWindow
File "direct/showbase/ShowBase.py", line 749, in <lambda>
File "direct/showbase/ShowBase.py", line 821, in _doOpenWindow
File "direct/showbase/ShowBase.py", line 650, in makeDefaultPipe
File "direct/directnotify/Notifier.py", line 130, in error
Exception: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.
[5466] Failed to execute script 'Shipsim3d_1-1' due to unhandled exception!
Usually, there is a Config.prc file in the etc subdirectory of the panda3d site-package directory. This file is non-existent in the packaged version. But if I create this subdirectory there, and copy the files to it as well, it still doesn't work and it still throws the same exception. There is a line "loadPrcData("win-size 1080 1920")" in my main program as well. Could this be part of the problem in any way? Or is there something else i am missing?
Thanks in advance
I solved this problem by including the whole panda3d lib:
pyinstaller --add-data="path/to/panda3d;panda3d" -wF main.py
I am able to run my exe file but my scripts has multiple pip libraries for it to work. I always get this error when running my script.
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.py", line 932, in _bootstrap_inner
File "threading.py", line 870, in run
File "AIO_Bot.py", line 265, in main_function
File "cloudscraper/__init__.py", line 665, in create_scraper
File "cloudscraper/__init__.py", line 120, in __init__
File "cloudscraper/user_agent/__init__.py", line 20, in __init__
File "cloudscraper/user_agent/__init__.py", line 77, in loadUserAgent
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/8g/gkf53znx7_7405c26w344ftw0000gn/T/_MEIujM2ll/cloudscraper/user_agent/browsers.json'
Finished in 0.0 second(s)
If anyone knows how to fix this please help!
It seems that your browswers.json is expected to be found in a relative path from the "exe" (cloudscraper/user_agent) when it is not the case when it is really a exe file. You have to modify your pyinstaller build command to include that file in the package. Add
--add-data '/lib/python3.8/site-packages/cloudscraper/user_agent/browsers.json:cloudscraper/user_agent' and it should work. (replace : with ; on Windows)
You can refer to https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-data-files for more details.
It seems your script/exe is looking for a file named "browsers.json".
Locate it and try putting it in the same folder as your created *.exe
The file is not being located because you are searching through a path that can not be opened. If your script is on the same level of the path then you would only have to do this
(browsers.json)
to fix this just exclude the directory path
mv /lib/python3.8/site-packages/cloudscraper/user_agent/browsers.json /var/folders/8g/gkf53znx7_7405c26w344ftw0000gn/T/_MEIujM2ll/cloudscraper/user_agent/
if this does not work pip install cloudscraper in terminal instead because pycharms assigniing the file to it's own enviroment
I'm getting the error below when trying to install packages in IronPython via pip. I've tried running cmd as an Administrator and also adding "--user" in the command, but it always leads to the same error.
I get the same error if if I try to install different packages - so it shouldn't be because of any specific package.
I've also tried using the Python Environments window in Visual Studio to get the packages or update PIP, but it fails in the same way.
Is anyone able to advise on what the likely issue is? Alternatively, I'm happy to get an advice on an alternative way to install packages.
Traceback (most recent call last):
File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pip\basecommand.py", line 209, in main
status = self.run(options, args)
File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pip\commands\install.py", line 299, in run
requirement_set.prepare_files(finder)
File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pip\req\req_set.py", line 356, in prepare_files
discovered_reqs.extend(self._prepare_file(
File "C:\Program Files (x86)\IronPython 2.7\Lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pip\utils\logging.py", line 36, in indent_log
yield
SystemError: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
I run Canopy version Version: 2.1.3.3542 (64 bit) on Windows 10.
Canopy cant manage to update any package, all results in the same
log output for a numpy update (for example):
Warming up...
Traceback (most recent call last):
File "build\bdist.win-amd64\egg\canopy_dashboard\packman\package_action_worker.py", line 54, in run
File "build\bdist.win-amd64\egg\canopy_dashboard\packman\package_action.py", line 196, in execute
File "build\bdist.win-amd64\egg\canopy_dashboard\packman\packman.py", line 626, in <lambda>
File "build\bdist.win-amd64\egg\canopy_dashboard\packman\packman.py", line 1051, in _install
File "build\bdist.win-amd64\egg\canopy_platform\cpython_packages_manager.py", line 152, in install_packages_prompt
File "build\bdist.win-amd64\egg\canopy_platform\cpython_packages_manager.py", line 137, in _install_packages_prompt
PackagesInstallationError: installation of packages ['numpy 1.11.3-3'] failed. Details below:
Traceback (most recent call last):
File "build\bdist.win-amd64\egg\canopy_platform\edm_api.py", line 64, in wrapper
File "build\bdist.win-amd64\egg\canopy_platform\edm_api.py", line 384, in install_command
File "build\bdist.win-amd64\egg\canopy_platform\edm_api.py", line 414, in _install_packages_command
File "build\bdist.win-amd64\egg\edm\core\packages_manager.py", line 124, in decorator
File "build\bdist.win-amd64\egg\edm\core\packages_manager.py", line 219, in install_command
File "build\bdist.win-amd64\egg\edm\core\packages_manager.py", line 223, in _install_command
File "build\bdist.win-amd64\egg\edm\core\packages_manager.py", line 549, in _compute_fix_aborted_actions
AbortedOperationDetected: Aborted operation detected in environment 'User'
There is absolutly 0 results on google for this error code, so stackexchange is my last resort
It looks like a previous update was force-aborted, possibly leaving the environment corrupted. Assuming that you are using the standard installer, then it should suffice to
reboot your computer
temporarily disable your anti-virus software if possible (or at least disable its more intrusive / slow functionality, such as online checking each of the tens of thousands of package files that Canopy provides),
from the Canopy Tools menu, select Troubleshoot => Reset Python environment