Python error access is denied

3

You're giving this error while trying to run the project: before that I had installed python 2.6 on the machine ... but I already had python 2.7 could this have caused the error?

  

[Error 5] Access is denied:   'Python-Eggs \ mysql_python-1.2.4-py2.7-win32.egg-tmp \ _mysql.pyd' C: \ Users \ Administrator \ AppData \ Roaming \      

The Python egg cache directory is currently set to:

     C: \ Users \ Administrator \ AppData \ Roaming \ Python-Eggs

     

Perhaps your account does not have access to this directory?   You can change the cache directory by setting the PYTHON_EGG_CACHE   environment variable to point to an accessible directory.

Has anyone gone through this ?? Do you know or have an idea how I can solve?

    
asked by anonymous 01.09.2014 / 18:40

2 answers

1

When you have two versions of Python installed on the same computer, they generally live side-by-side if installed correctly. In the case of Windows, there are a few things to keep in mind:

  • A separate registry entry will be created for each of them (ex: HKEY_LOCAL_MACHINE \ SOFTWARE \ Python \ PythonCore \ 2.7 ). I think that this goes even for smaller versions (% with% vs.% with%), but I'm not sure.

    Within this entry there is a 2.6 key showing where Python is installed. If possible, check this (via 2.7 ) and make sure that the version you are trying to run is accessible (if it is inside the admin home folder, you will probably only be able to access it if you run the system as an administrator).

  • Sometimes one of them will stop at the environment variable PythonPath - to allow Python to execute by simply typing regedit instead of the full path to the executable. It may be that the wrong version is in the path, and your system is calling it instead of the correct version.

In addition, if your system is a Django site / application deployed via Apache, it is important that Apache finds the correct version of python. From what you described, before when there was only one version worked well, but then when the other was installed it stopped working. This strongly suggests that the second version overwrote / gained precedence in PATH and therefore Apache is trying to use it instead of the old one.

The most common form of Python / Apache integration is via python . It is also possible to do this using obsolete PATH and, in the case of Django, in some other ways too (eg mod_wsgi ). Find out which one your project is using, and find the information you need to specify one python among several. At mod_python , for example, it's through the FastCGI property. It must be set in the Apache configuration file. Maybe your error has something to do with mod_wsgi instead (the error message was about something involving the "egg cache"). Other settings that may be helpful are: WSGIPythonExecutable and WSGIPythonEggs (in doubt, seven all of them, according to the documentation).

Update: I just remembered that support for WSGIPythonPath on Windows is weak ... From what I read from the documentation linked above, most of these properties are not well supported in this environment. If so, I'm afraid your only way out will be to install a single version of Python ...

Finally, if the problem is not in Apache, but in the tool you're using to debug WSGIPythonHome , you'll need to see in its settings how to specify the correct version to use. When that, I'm afraid I can not help ...

    
01.09.2014 / 19:53
1

I was able to solve this as well. I uninstalled all the versions of python and cleaned the registry after I installed the 2.7 version, it worked normal ... Thanks for the help. D:

Updated: It was not because of the versions that gave this error but because of a new IDE that I decided to test ... pyCharm flame it is great .. just do not know why this happened .. type if I reinstall and squeeze the project in eclipse goes normal .. ai if I run once in pyCharm will give an error (which in case it is this) and then starts to generate this error thereafter both pro eclipse and pro pyCharm .

    
01.09.2014 / 21:05