Can not install ggplot for Python on Windows 7, Anaconda 5 - python-3.x

I am trying to install ggplot for Python, see below:
All three commands return error messages. The first one is perhaps the most elaborate:
Exception:
Traceback (most recent call last):
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\shutil.py", line 387, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\AKONST~1\\AppData\\Local\\Temp\\pip-y54n7lcl-uninstall\\users\\akonstantinidis\\appdata\\local\\continuum\\anaconda3\\lib\\site-packages\\numpy\\core\\multiarray.cp36-win_amd64.pyd'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\req\req_set.py", line 795, in install
requirement.commit_uninstall()
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\req\req_install.py", line 767, in commit_uninstall
self.uninstalled.commit()
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\req\req_uninstall.py", line 142, in commit
rmtree(self.save_dir)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 212, in call
raise attempt.get()
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\six.py", line 686, in reraise
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\_vendor\retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\utils\__init__.py", line 102, in rmtree
onerror=rmtree_errorhandler)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\shutil.py", line 494, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\shutil.py", line 384, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\shutil.py", line 384, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\shutil.py", line 384, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
[Previous line repeated 6 more times]
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\shutil.py", line 389, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\akonstantinidis\AppData\Local\Continuum\anaconda3\lib\site-packages\pip\utils\__init__.py", line 114, in rmtree_errorhandler
func(path)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\AKONST~1\\AppData\\Local\\Temp\\pip-y54n7lcl-uninstall\\users\\akonstantinidis\\appdata\\local\\continuum\\anaconda3\\lib\\site-packages\\numpy\\core\\multiarray.cp36-win_amd64.pyd'
I am not sure what these messages imply and how they should be dealt with.
Your advice will be appreciated.

Try running the installation as administrator.Right click the anoconda prompt and select run as administrator and then run the installation.You will need an admin user to do this.

Related

PyInstaller --onefile is throwing file not found error

I am trying to make an executable of a python 3.10 file using PyInstaller in the command prompt:
python -m PyInstaller --onefile 1.0.py
with "1.0" being my file name. I have done this many times before on the same PC and with the same python version, but for this file it is throwing a "file specified not found" error:
while run_next_command(read_fh, write_fh):
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\__main__.py", line 188, in <module>
run()
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\__main__.py", line 178, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\__main__.py", line 59, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 934, in main
build(specfile, distpath, workpath, clean_build)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 856, in build
exec(code, spec_namespace)
File "E:\Python Scripts\High Spen\Combined\1.0.spec", line 7, in <module>
a = Analysis(
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 381, in __init__
self.__postinit__()
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\datastruct.py", line 173, in __postinit__
self.assemble()
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 660, in assemble
isolated.call(find_binary_dependencies, list(self.binaries), self.binding_redirects, collected_packages)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\isolated\_parent.py", line 238, in call
return isolated.call(function, *args, **kwargs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\isolated\_parent.py", line 176, in call
raise RuntimeError(f"Child process call to {function.__name__}() failed with:\n" + output)
RuntimeError: Child process call to find_binary_dependencies() failed with:
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\core\cffi\_dll.py", line 23, in _LoadLibraryEx
result = check_null(
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\core\cffi\_util.py", line 81, in __call__
self._raise_error(function_name)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\core\cffi\_util.py", line 92, in _raise_error
raise exception
OSError: [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:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command
output = function(*args, **kwargs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 162, in find_binary_dependencies
return bindepend.Dependencies(binaries, redirects=binding_redirects, xtrapath=extra_libdirs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\depend\bindepend.py", line 205, in Dependencies
for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\depend\bindepend.py", line 372, in getAssemblyFiles
for assembly in getAssemblies(pth):
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\depend\bindepend.py", line 326, in getAssemblies
res = winmanifest.GetManifestResources(pth)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\utils\win32\winmanifest.py", line 979, in GetManifestResources
return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\utils\win32\winresource.py", line 155, in GetResources
hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\win32api.py", line 42, in LoadLibraryEx
with _pywin32error():
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryEx', 'The system cannot find the file specified')
Please could someone let me know how I would solve this or otherwise another method of turning this into an .exe. Thanks
Update:
I have tried uninstalling my python 3.10 and downloading 3.7 instead, as I saw somewhere that PyInstaller is incompatible with 3.8 and above, but this still didn't work for another reason. So I reinstalled 3.10 (effectively at this point I have uninstalled and reinstalled my python and IDE) and I am still getting the same error.

ImportError: Module 'django.contrib' does not contain a 'Advisor' class. ------- why am I getting this error

Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\core\management\__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\mgkco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\django\apps\config.py", line 225, in create
raise ImportError(msg)
ImportError: Module 'django.contrib' does not contain a 'Advisor' class.
You're getting that error because you, for some reason, have django.contrib.Advisor in your INSTALLED_APPS setting.
Did you maybe mean django.contrib.admin?

pypy Ensure pip error ("C:\pypy3.exe -m ensurepip") windows 10

I am trying to install pypy pip installation howveer there is this bug when I try to run pypy3 -m ensurepip I have a 64bit windows 10 os system. I get this error when I try to run the program in cmd:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\distutils\util.py", line 192, in subst_vars
return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s)
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\re.py", line 194, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\distutils\util.py", line 189, in _subst
return os.environ[var_name]
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\os.py", line 681, in __getitem__
raise KeyError(key) from None
KeyError: 'EXa8572'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\cli\base_command.py", line 188, in _main
status = self.run(options, args)
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\cli\req_command.py", line 185, in wrapper
return func(self, options, args)
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\commands\install.py", line 257, in run
isolated_mode=options.isolated_mode,
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\commands\install.py", line 599, in decide_user_install
if site_packages_writable(root=root_path, isolated=isolated_mode):
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\commands\install.py", line 544, in site_packages_writable
test_writable_dir(d) for d in set(get_lib_location_guesses(**kwargs))
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\commands\install.py", line 538, in get_lib_location_guesses
scheme = distutils_scheme('', *args, **kwargs)
File "C:\Users\maste\AppData\Local\Temp\tmpjdn5f_qd\pip-20.1.1-py2.py3-none-any.whl\pip\_internal\locations.py", line 125, in distutils_scheme
i.finalize_options()
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\distutils\command\install.py", line 321, in finalize_options
self.expand_basedirs()
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\distutils\command\install.py", line 495, in expand_basedirs
self._expand_attrs(['install_base', 'install_platbase', 'root'])
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\distutils\command\install.py", line 489, in _expand_attrs
val = subst_vars(val, self.config_vars)
File "C:\Users\maste\AppData\Local\Temp\Rar$EXa8572.21538\pypy3.7-v7.3.3-win32\lib-python\3\distutils\util.py", line 194, in subst_vars
raise ValueError("invalid variable '$%s'" % var)
ValueError: invalid variable '$'EXa8572''**strong text**

error while importing "wikipedia module" in pycharm

(venv) D:\Jarvis>pip install wikipedia
Collecting wikipedia
Using cached https://files.pythonhosted.org/packages/67/35/25e68fbc99e672127cc6fbb14b8ec1ba3dfef035bf1e4c90f78f24a80b7d/wikipedia-1.4.0.tar.gz
Collecting beautifulsoup4 (from wikipedia)
Using cached https://files.pythonhosted.org/packages/1d/5d/3260694a59df0ec52f8b4883f5d23b130bc237602a1411fa670eae12351e/beautifulsoup4-4.7.1-py3-none-any.whl
Collecting requests<3.0.0,>=2.0.0 (from wikipedia)
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting soupsieve>=1.2 (from beautifulsoup4->wikipedia)
Using cached https://files.pythonhosted.org/packages/b9/a5/7ea40d0f8676bde6e464a6435a48bc5db09b1a8f4f06d41dd997b8f3c616/soupsieve-1.9.1-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests<3.0.0,>=2.0.0->wikipedia)
Using cached https://files.pythonhosted.org/packages/69/1b/b853c7a9d4f6a6d00749e94eb6f3a041e342a885b87340b79c1ef73e3a78/certifi-2019.6.16-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests<3.0.0,>=2.0.0->wikipedia)
Using cached https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests<3.0.0,>=2.0.0->wikipedia)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests<3.0.0,>=2.0.0->wikipedia)
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Installing collected packages: soupsieve, beautifulsoup4, certifi, urllib3, chardet, idna, requests, wikipedia
Running setup.py install for wikipedia ... done
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\Users\dp49814\AppData\Local\Temp\pip-record-mi8vmwb5\install-record.txt'
Consider using the --user option or check the permissions.
Exception:
Traceback (most recent call last):
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 393, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\Users\dp49814\AppData\Local\Temp\pip-install-el1ufi7c\wikipedia\build\lib\wikipedia\exceptions.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\commands\install.py", line 436, in run
requirement_set.cleanup_files()
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\req\req_set.py", line 197, in cleanup_files
req.remove_temporary_source()
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\req\req_install.py", line 371, in remove_temporary_source
rmtree(self.source_dir)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 212, in call
raise attempt.get()
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\six.py", line 693, in reraise
raise value
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\utils\misc.py", line 121, in rmtree
onerror=rmtree_errorhandler)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 500, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 390, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 390, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 390, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 395, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\utils\misc.py", line 133, in rmtree_errorhandler
func(path)
PermissionError: [WinError 5] Access is denied: 'C:\Users\dp49814\AppData\Local\Temp\pip-install-el1ufi7c\wikipedia\build\lib\wikipedia\exceptions.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\commands\install.py", line 437, in run
wheel_cache.cleanup()
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\utils\temp_dir.py", line 60, in exit
self.cleanup()
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\utils\temp_dir.py", line 83, in cleanup
rmtree(self.path)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 212, in call
raise attempt.get()
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\six.py", line 693, in reraise
raise value
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_vendor\retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\utils\misc.py", line 121, in rmtree
onerror=rmtree_errorhandler)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 500, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 390, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 390, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\dp49814\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 395, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "D:\Jarvis\venv\lib\site-packages\pip-19.0.3-py3.6.egg\pip_internal\utils\misc.py", line 133, in rmtree_errorhandler
func(path)
PermissionError: [WinError 5] Access is denied: 'C:\Users\dp49814\AppData\Local\Temp\pip-install-el1ufi7c\beautifulsoup4\beautifulsoup4-4.7.1.dist-info\COPYING.txt'
Based from the error message, big chance the error is permission-related.
Have you checked this link:
python permission issue on windows

'Permission Error' (denied) while writing xml file using ElementTree on Odoo11 (Odoo.sh)

I'm getting the following error. Which is about permissions. The error occurs when I call a custom method through an action. The custom method will create an .xml using ElementTree library.
The code inside the method is about 1500+ lines so putting it in here wouldn't be optimal. But I believe the method is rejected when trying the following
tree.write("20100066603-01-F001-1.xml", "ISO-8859-1", True)
This is the error. Odoo returns
Error:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 789, in _get_writer
write = file_or_filename.write
AttributeError: 'str' object has no attribute 'write'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/safe_eval.py", line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 2, in <module>
File "/usr/lib/python3/dist-packages/odoo/addons/myModule/models/models.py", line 1141, in x_nc_create_xml
tree.write("20100066603-01-F001-1.xml", "ISO-8859-1", True)
File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 759, in write
with _get_writer(file_or_filename, enc_lower) as write:
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 796, in _get_writer
errors="xmlcharrefreplace")
PermissionError: [Errno 13] Permission denied: '20100066603-01-F001-1.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 650, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 692, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 936, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1231, in run
result = request.env['ir.actions.server'].browse([action_id]).run()
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 554, in run
res = func(action, eval_context=eval_context)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 430, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "/usr/lib/python3/dist-packages/odoo/tools/safe_eval.py", line 373, in safe_eval
pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/odoo/tools/safe_eval.py", line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 2, in <module>
File "/usr/lib/python3/dist-packages/odoo/addons/myModule/models/models.py", line 1141, in x_nc_create_xml
tree.write("20100066603-01-F001-1.xml", "ISO-8859-1", True)
File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 759, in write
with _get_writer(file_or_filename, enc_lower) as write:
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 796, in _get_writer
errors="xmlcharrefreplace")
ValueError: <class 'PermissionError'>: "13
Permission denied" while evaluating
'if records: \n action = records.x_nc_create_xml()'
I have already tried the same code on PyCharm and it worked. So I believe, this is an issue about permissions on Odoo.
How do I set permission for my module to create,edit and delete files it creates?
PD:If this is unlikely to achieve on Odoo.sh, then how can I do it on a Local installation? I currently have both.
use command chmod 777 * this will allow all kind of access to all of your custom modules and if you want to give permission to only one module use name of module instead of * like this chmod 777 module_name

Resources