AMP-SCZ / dpanonymize

Personally identifiable information remover
Apache License 2.0
0 stars 0 forks source link

Installation scheme does not work #3

Closed tashrifbillah closed 3 years ago

tashrifbillah commented 3 years ago

The installation scheme does not work even after making the repo public and omitting release tag!

(base) [tb571@rc-predict ~]$ pip install git+https://github.com/AMP-SCZ/dpanonymize.git

Collecting git+https://github.com/AMP-SCZ/dpanonymize.git
Cloning https://github.com/AMP-SCZ/dpanonymize.git to /tmp/pip-req-build-2eblivfy
ERROR: Command errored out with exit status 1:
command: /home/tb571/min3-dpdash/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-2eblivfy/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-2eblivfy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-pxejd1xv
cwd: /tmp/pip-req-build-2eblivfy/
Complete output (4 lines):
running egg_info
/home/tb571/min3-dpdash/lib/python3.8/site-packages/setuptools/dist.py:452: UserWarning: Normalizing 'v0.1' to '0.1'
warnings.warn(tmpl.format(**locals()))
error: Invalid distribution name or version syntax: dpanonymize--0.1
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
kcho commented 3 years ago

Thanks, now dpanonymize up in the pypi. Installation works now - Tested.

pip install git+https://github.com/PREDICT-DPACC/lochness.git@kcho/link_bpanonymize
tashrifbillah commented 3 years ago

scripts/anonymize_phoenix.py

Has it been renamed to dpanon.py? (No action necessary for you)

kcho commented 3 years ago

scripts/anonymize_phoenix.py

Has it been renamed to dpanon.py? (No action necessary for you)

Yes. I wanted to give it a different name from the dpanonymize library folder name.

tashrifbillah commented 3 years ago

So I figured the dependency is the other way--for dpanon.py --help to work, lochness needs to be installed. But I think you made dpanonymize a dependency of lochness here.

kcho commented 3 years ago

Thanks for spotting this. pii removal of the survey uses atomic_write function from lochness. I'll make a hard copy of this function to dpanonymize to remove this dependency.

tashrifbillah commented 3 years ago

Will that hard copy make dpanonymize an independent package?

tashrifbillah commented 3 years ago

Without lochness, this is the error I got by the way:

(dpanonymize) [tb571@rc-predict-lochness dpanonymize]$ dpanon.py -h
Traceback (most recent call last):
  File "/home/tb571/miniconda3/envs/dpanonymize/bin/dpanon.py", line 7, in <module>
    from dpanonymize import dtype_module_dict
  File "/home/tb571/miniconda3/envs/dpanonymize/lib/python3.8/site-packages/dpanonymize/__init__.py", line 6, in <module>
    import dpanonymize.survey as SURVEY
  File "/home/tb571/miniconda3/envs/dpanonymize/lib/python3.8/site-packages/dpanonymize/survey/__init__.py", line 1, in <module>
    import lochness
ModuleNotFoundError: No module named 'lochness'
kcho commented 3 years ago

Will that hard copy make dpanonymize an independent package?

independent from lochness, yes.

kcho commented 3 years ago

Without lochness, this is the error I got by the way:

(dpanonymize) [tb571@rc-predict-lochness dpanonymize]$ dpanon.py -h
Traceback (most recent call last):
  File "/home/tb571/miniconda3/envs/dpanonymize/bin/dpanon.py", line 7, in <module>
    from dpanonymize import dtype_module_dict
  File "/home/tb571/miniconda3/envs/dpanonymize/lib/python3.8/site-packages/dpanonymize/__init__.py", line 6, in <module>
    import dpanonymize.survey as SURVEY
  File "/home/tb571/miniconda3/envs/dpanonymize/lib/python3.8/site-packages/dpanonymize/survey/__init__.py", line 1, in <module>
    import lochness
ModuleNotFoundError: No module named 'lochness'

Yes, this dependency is coming from this one. https://github.com/AMP-SCZ/dpanonymize/issues/3#issuecomment-875050255

tashrifbillah commented 3 years ago

Problem with hard link/copy is that if you need to modify that module, you will have to modify it in two places ... :(

kcho commented 3 years ago

Will that hard copy make dpanonymize an independent package?

but lochness will depend on dpanonymize

kcho commented 3 years ago

Problem with hard link/copy is that if you need to modify that module, you will have to modify it in two places ... :(

We can keep it as it is for now, since for our projects, we will have both of them installed anyway. What's your thought on this?

tashrifbillah commented 3 years ago

We can keep it as it is for now

Yeah probably this is the better idea. This thread will serve as the documentation that if someone needs to install just dpanonymize, they should also install lochness.