nie można utworzyć '/ Library/Python / 2.7/site-packages / xlrd': Odmowa uprawnień
Próbuję zainstalować xlrd na mac 10.8.4, aby móc czytać pliki Excela przez python.
Wykonałem instrukcje na http://www.simplistix.co.uk/presentations/python-excel.pdf
Zrobiłem to:
-
Rozpakuj folder na pulpit
-
W terminalu cd do rozpakowanego folderu
-
$ python setup.py install
Oto co dostaję:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/xlrd
copying xlrd/__init__.py -> build/lib/xlrd
copying xlrd/biffh.py -> build/lib/xlrd
copying xlrd/book.py -> build/lib/xlrd
copying xlrd/compdoc.py -> build/lib/xlrd
copying xlrd/formatting.py -> build/lib/xlrd
copying xlrd/formula.py -> build/lib/xlrd
copying xlrd/info.py -> build/lib/xlrd
copying xlrd/licences.py -> build/lib/xlrd
copying xlrd/sheet.py -> build/lib/xlrd
copying xlrd/timemachine.py -> build/lib/xlrd
copying xlrd/xldate.py -> build/lib/xlrd
copying xlrd/xlsx.py -> build/lib/xlrd
creating build/lib/xlrd/doc
copying xlrd/doc/compdoc.html -> build/lib/xlrd/doc
copying xlrd/doc/xlrd.html -> build/lib/xlrd/doc
creating build/lib/xlrd/examples
copying xlrd/examples/namesdemo.xls -> build/lib/xlrd/examples
copying xlrd/examples/xlrdnameAPIdemo.py -> build/lib/xlrd/examples
running build_scripts
creating build/scripts-2.7
copying and adjusting scripts/runxlrd.py -> build/scripts-2.7
changing mode of build/scripts-2.7/runxlrd.py from 644 to 755
running install_lib
creating /Library/Python/2.7/site-packages/xlrd
error: could not create '/Library/Python/2.7/site-packages/xlrd': Permission denied
Dlaczego pozwolenie odmawiam? Dzięki
41
3 answers
Try sudo python setup.py install
Folder /Library wymaga uprawnień roota.
6
Author: arynhard,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-08-13 02:51:58
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-08-13 02:51:58
Try python setup.py install --user
Nie powinieneś używać sudo
jak sugerowano powyżej z dwóch powodów:
- pozwalasz, aby dowolny niezaufany kod z internetu był uruchamiany jako root
- przekazanie znacznika
--user
dopython setup.py install
spowoduje zainstalowanie pakietu w katalogu należącym do użytkownika. Twój zwykły użytkownik spoza roota nie będzie mógł uzyskać dostępu do plików zainstalowanych przezsudo pip
lubsudo python setup.py
154
Author: Louis Maddox,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-02-20 07:46:15
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-02-20 07:46:15
Spróbuj w virtualenv
:
- sudo pip install virtualenvwrapper
- mkvirtualenv
- workon
- python setup.py install
4
Author: Nitin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-09-02 22:33:45
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-09-02 22:33:45