Python error access is denied

Asked

Viewed 221 times

3

This gives this error when trying to run the project: before that I had installed python 2.6 on the machine ... but it already had python 2.7 will have caused the error ?

[Error 5] Access is denied: 'C: Users Administrator Appdata Roaming Python-Eggs mysql_python-1.2.4-py2.7-Win32. Egg-tmp _mysql.pyd'

The Python Egg cache directory is Currently set to:

C: Users Administrator Appdata Roaming Python-Eggs

Perhaps your Account does not have write 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 ever been through it ?? knows or has an idea how I can solve it ?

  • 2

    When did this error occur? Were you trying to install something? Or was it while running some other program? Please edit your question by clarifying the context in which this error occurred.

  • I don’t know how to answer you, even with the new information ("compile the project"? that I know python doesn’t compile...), but I can already get some idea of what might be happening: 1) maybe you are running the wrong python; if you - or some other code indirectly started - are using python python.exe who is in the PATH, this may not be the same Python you want to run. Another option is something involving PYTHONPATH. 2) If the problem is not this, and Python is even the correct one, you should have it installed as an administrator, not as an ordinary user.

  • Where can I find this path ? I’m layman in python and I’m picking up a system that another programmer left behind.. the system uses Django

  • Another option - if I’m interpreting the error message correctly - is that you installed a binary to interface python with mysql in administrator mode, and now you’re trying to execute a code that uses this binary in common user mode. P.S. The PATH is a Windows environment variable. How to find it depends on the windows version, but if you type in the console echo %path% you can see its value. P.P.S. Hardly the problem is in Django, but it tells me how you are running? (runserver or via external webserver, e.g. apache)

  • So. the system is on top of python27 I am debugging with pydev ... via apache ... this error started occurring after installing python 2.6 on the computer

  • ih, I don’t know anything about pydev... :( I’ll write a generic response, so you can take the situation, and who knows how to guide in the search for a solution. If not, the way will be to wait for someone who is familiar with this tool to come here and answer.

Show 1 more comment

2 answers

1


When you have two versions of Python installed on the same computer, in general they coexist well side by side, if installed correctly. In the case of Windows, there are a few things to consider:

  • 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 to smaller versions (2.6 vs. 2.7), but I’m not sure.

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

  • Sometimes one of them will end up in the environment variable PATH - to allow you to run Python by simply typing python 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.

Also, 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 one was installed stopped working. This strongly suggests that the second version overwritten/gained precedence in the PATH and so Apache is trying to use it instead of the old.

The most common form of Python/Apache integration is via mod_wsgi. It is also possible to do so through the obsolete mod_python and, in the case of Django, in some other ways also (ex.: FastCGI). Find out which one your project is using, and look for the information needed to specify a python among several. In mod_wsgi, for example, it is through the property WSGIPythonExecutable. It must be set in the Apache settings file. Maybe your mistake has something to do with WSGIPythonEggs instead (the error message spoke of something involving the "Egg cache"). Other settings that may be useful are: WSGIPythonPath and WSGIPythonHome (in doubt, seven of them, according to the documentation).

Updating: I just remembered that the support for mod_wsgi in Windows is weak... From what I read in the documentation linked above, most of these properties are not well supported in this environment. If that’s the case, I’m afraid your only way out is to actually install a single version of Python...

Finally, if the problem is not in Apache, but in the tool you are using to debug pydev, will need to see in her settings how to specify the correct version to be used. When to do so, I’m afraid I can’t help...

  • I entered the regedit and went on pythonpath is set with this value C: Python33 Lib;C: Python33 Dlls ... also has python33 on the machine..

  • @Wisneroliveira Cara, what a salad! : P Fortunately, you can get around all this. By the way, there was an error in my answer, the right property is WSGIPythonExecutable - although the rest (...Path, ...Home and ...Eggs) could also be important, I don’t know.

1

I managed to solve it as follows.. I uninstalled all versions of python and cleaned the registry then installed version 2.7 ai worked normal... Thanks for the help man :D

Updated: It was not because of the versions that gave this error but because of a new IDE that I decided to test... calls pyCharm she is great .. I just don’t know why it happened.. like if I reinstall and run the project in the eclipse goes normal.. ai if I run once in pyCharm will give an error (that in the case is this) and then starts generating this error then both pro eclipse and pyCharm.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.