Py_DSSATTools icon indicating copy to clipboard operation
Py_DSSATTools copied to clipboard

OSError: [WinError 1314] A required privilege is not held by the client

Open eusojk opened this issue 6 months ago • 0 comments

First off, thanks very much, dear @daquinterop, for open-sourcing a fantastic tool like this. I (and I am sure the community also) appreciate your efforts!

Information

Upon a successful install, I followed along with the notebooks from Example 1 (Basics).ipynbs. I ran into the following issue:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 1
----> 1 from DSSATTools import (
      2     Crop, SoilProfile, Weather, Management, DSSAT, SoilLayer,
      3     available_cultivars
      4 )
      5 import DSSATTools
      6 import pandas as pd

File c:\Users\self\AppData\Local\anaconda3\envs\ee\Lib\site-packages\DSSATTools\__init__.py:78
     76 from DSSATTools.weather import Weather
     77 from DSSATTools.management import Management
---> 78 from DSSATTools.run import DSSAT
     79 from DSSATTools.base.sections import TabularSubsection
     81 __all__ = [
     82     'Crop', 'SoilProfile', 'SoilLayer', 'Weather', 'Management', 'DSSAT', 
     83     'TabularSubsection', "available_cultivars"
     84     ] 

File c:\Users\self\AppData\Local\anaconda3\envs\ee\Lib\site-packages\DSSATTools\run.py:63
     61     if os.path.exists(file_link):
     62         os.remove(file_link)
---> 63     os.symlink(os.path.join(STATIC_PATH, file), file_link)
     65 if 'windows'in OS:
     66     BIN_PATH = os.path.join(STATIC_PATH, 'bin', 'dscsm048.exe')

OSError: [WinError 1314] A required privilege is not held by the client: 'c:\\Users\\self\\AppData\\Local\\anaconda3\\envs\\ee\\Lib\\site-packages\\DSSATTools\\static\\bin' -> 'C:\\Users\\self\\AppData\\Local\\Temp\\DSSAT048\\bin'

I thought it would be more fitting to open up the issue here instead of over at DSSATTools_notebooks. But please let me know if I should add the issue over there instead.

Environment info

  • dssattools version: 2.1.3
  • Python version: 3.12 (via a conda env)
  • Conda: 24.5.0
  • Platform: Windows 11

To reproduce

Steps to reproduce the behavior (after installing the library):

  • install library
  • clone https://github.com/daquinterop/DSSATTools_notebooks
  • open file Example 1 (Basics).ipynb in VSCode & run the first cell

Temporary Workaround

  • Open up a conda command prompt with Admin privileges
  • Activate the right conda env (where dssattools is installed)
  • Convert the Example 1 (Basics).ipynb notebook into a Python script
  • And run the script

The steps above seem to indicate that dssattools requires elevated/Admin privileges on Windows before running. So, this could be a potential source of the problem? Because, I ran into the same problem when executing the script in a non-Admin Python/conda env. Is this Admin requirement necessary for dssattools?

Thanks very much in advance for your assistance!

eusojk avatar Aug 20 '24 16:08 eusojk