jrkerns / pylinac

An image analysis library for medical physics
MIT License
145 stars 94 forks source link

The 'argue' dependency appears to be depreciated and Pylinac doesnt recognise the module #402

Closed morganHealy closed 2 years ago

morganHealy commented 2 years ago

I having issues importing the Pylinac module becuase the argue module available on https://pypi.org/ doesnt work.

I get the following error when attempting to import pylinac:

Traceback (most recent call last): File "C:/Users/morgan.healy/Desktop/IC Profiler python/profileComparison.py", line 5, in import pylinac File "C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\lib\site-packages\pylinac__init__.py", line 12, in from pylinac.ct import CatPhan504, CatPhan600, CatPhan503, CatPhan604 File "C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\lib\site-packages\pylinac\ct.py", line 31, in from .core import image, pdf File "C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\lib\site-packages\pylinac\core\image.py", line 24, in from .io import get_url, TemporaryZipDirectory, retrieve_filenames, is_dicom_image, retrieve_dicom_file File "C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\lib\site-packages\pylinac\core\io.py", line 15, in from pylinac.core.profile import SingleProfile File "C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\lib\site-packages\pylinac\core\profile.py", line 61, in class ProfileMixin: File "C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\lib\site-packages\pylinac\core\profile.py", line 109, in ProfileMixin @argue.options(kind=('median', 'gaussian')) AttributeError: module 'argue' has no attribute 'options'

jrkerns commented 2 years ago

Hi Morgan, Are you using an older version of argue? I've not updated that library in quite some time. The most recent code has options in it: https://gitlab.com/jrkerns/argue/-/blob/master/argue/argumentative.py#L5. You can try upgrading with pip install argue --upgrade. You should get v0.3.1 from pypi. Let me know how it goes.

morganHealy commented 2 years ago

Hi James,

I tried using pip but it's a work computer and I think the firewall blocked the installation. I got the following response in command line:

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1106: The handshake operation timed out'))': /simple/argue/

After about 5 retries it terminated saying:

ERROR: Could not find a version that satisfies the requirement argue (from versions: none) ERROR: No matching distribution found for argue

Nevertheless I am able to download repositories from GitHub and Python modules don't require administrator privileges, so I was able to install Argue eventually. After un-zipping I had to copy and paste the python.exe and python39.dll files into the expanded folder (at the same directory as setup.py), and then open command line and CD into that directory before running python setup.py install . This was repeated for all depndencies of Pylinac.

For some reason, Argue was more difficult and I also had to copy the entire expanded folder into C:\Users\morgan.healy\AppData\Local\Programs\Python\Python39\Lib\site-packages\ and I also had to move -init-.py and argumentative.py into their parent folder (same directory as setup.py). This took a lot of trial and error to figure out.