Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import Loader fails with permission denied (win7) #283

Closed
gisi90 opened this issue Aug 27, 2019 · 7 comments
Closed

import Loader fails with permission denied (win7) #283

gisi90 opened this issue Aug 27, 2019 · 7 comments

Comments

@gisi90
Copy link

gisi90 commented Aug 27, 2019

(envpy3) C:\>python Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Ana conda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

from skyfield.api import Loader

Traceback (most recent call last):
File "", line 1, in
File "D:\Programme\miniconda\envs\envpy3\lib\site-packages\skyfield\api.py", l
ine 21, in
load = Loader('.')
File "D:\Programme\miniconda\envs\envpy3\lib\site-packages\skyfield\iokit.py",
line 98, in init
os.makedirs(self.directory)
File "D:\Programme\miniconda\envs\envpy3\lib\os.py", line 221, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Zugriff verweigert: '.'`


(envpy3) C:\>conda list

packages in environment at D:\Programme\miniconda\envs\envpy3:
Name Version Build Channel
ca-certificates 2019.5.15 1
certifi 2019.6.16 py37_1
jplephem 2.9 pypi_0 pypi
numpy 1.17.1 pypi_0 pypi
openssl 1.1.1c he774522_1
pip 19.2.2 py37_0
python 3.7.4 h5263a28_0
setuptools 41.0.1 py37_0
sgp4 1.4 pypi_0 pypi
skyfield 1.11 pypi_0 pypi
sqlite 3.29.0 he774522_0
vc 14.1 h0510ff6_4
vs2015_runtime 14.15.26706 h3a45250_4
wheel 0.33.4 py37_0
wincertstore 0.2 py37_0

(envpy3) C:\>conda info

active environment : envpy3
active env location : D:\Programme\miniconda\envs\envpy3
shell level : 2
user config file : C:\Users\usr.condarc
populated config files : C:\Users\usr.condarc
conda version : 4.7.10
conda-build version : not installed
python version : 3.7.3.final.0
virtual packages :
base environment : D:\Programme\miniconda (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/default/win-64
https://conda.anaconda.org/default/noarch
package cache : D:\Programme\miniconda\pkgs
C:\Users\usr.conda\pkgs
C:\Users\usr\AppData\Local\conda\conda\pkgs
envs directories : D:\Programme\miniconda\envs
C:\Users\usr.conda\envs
C:\Users\usr\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Windows/7 W
indows/6.1.7601
administrator : False
netrc file : None
offline mode : False

@brandon-rhodes
Copy link
Member

That is an interesting error! I looks like makedirs(), which should not do anything if the directory already exists, is getting confused and trying to mkdir() the current directory ..

I have just committed a possible fix. If you'll try this:

pip install https://github.com/skyfielders/python-skyfield/archive/master.zip

then you might be able to get past the error. Let me know what happens!

@gisi90
Copy link
Author

gisi90 commented Aug 28, 2019

Thank you. I tried and now get a NameError:

from skyfield.api import Loader

Traceback (most recent call last):
File "D:\Programme\miniconda\envs\envpy3\lib\site-packages\skyfield\iokit.py",
line 98, in init
os.makedirs(self.directory)
File "D:\Programme\miniconda\envs\envpy3\lib\os.py", line 221, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Zugriff verweigert: '.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "D:\Programme\miniconda\envs\envpy3\lib\site-packages\skyfield\api.py", l
ine 21, in
load = Loader('.')
File "D:\Programme\miniconda\envs\envpy3\lib\site-packages\skyfield\iokit.py",
line 100, in init
if e.errno != errno.EEXIST and not os.path.isdir(name):
NameError: name 'name' is not defined

@brandon-rhodes
Copy link
Member

Drat, I cut-and-pasted that code from the modern Standard Library without changing "name" to the actual variable that holds the directory name in this case.

I've updated the code, please try again!

@ReimarBauer
Copy link

Hi @brandon-rhodes
we do use your library in our mission support system and @gisi90 tracked it down.
https://bitbucket.org/wxmetvis/mss/issues/446/mss-python-crashes-when-started-in-conda

Do you plan a minor bug fix release with this improvement?

@gisi90
Copy link
Author

gisi90 commented Aug 28, 2019

I've updated the code, please try again!

@brandon-rhodes
Great, now it works!

@brandon-rhodes
Copy link
Member

@ReimarBauer Yes, I've just released a new version that includes the fix. Enjoy!

@ReimarBauer
Copy link

@ReimarBauer Yes, I've just released a new version that includes the fix. Enjoy!

Many Thanks, just pushed a new build for our application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants