econ-ark / DemARK

Demonstrations of how to use material in the Econ-ARK
https://econ-ark.github.io/DemARK/
Apache License 2.0
33 stars 93 forks source link

Case sensitivity with mac #73

Closed JackShiqiLi closed 4 years ago

JackShiqiLi commented 5 years ago

I just encountered the problem that if I want to use the installed version of HARK instead of the cloned version, then I have to change the module name in the site-packages folder to 'HARK' as mac is case sensitive and the module is installed as 'hark'. When this is not done, I had an ModuleNotFoundError. I am not sure whether this is my own problem or not, just in case someone has the same problem with me. The path of my module is /Users/username/anaconda3/lib/python3.7/site-packages/hark, changing 'hark' to 'HARK' resolve the problem.

llorracc commented 5 years ago

@JackShiqiLi, do you know whether you installed using pip install econ-ark or conda install -c conda-forge econ-ark? Also, are you using the newest release of MacOS, "Catalina"? (I read somewhere that with Catalina the MacOS has moved from being "case-preserving" to being "case-sensitive").

In any case, could you just pip uninstall econ-ark and conda remove econ-ark then reinstall by one or the other of the methods and see if the file path problem is the same?

PS. Macs and Linux machines are case sensitive, but Windows machines are not, so usually problems like this reflect some scenario where a Windows machine was involved in creating the resource.

@MridulS, when @JackShiqiLi reports back on the results of the experiment described above, could you weigh in on what you think we should do to fix the problem permanently? Maybe there's some Travis test that could be set up that would fail when the pathname is the wrong case?

JackShiqiLi commented 5 years ago

I am pretty sure that I have tried both installation yesterday, actually I have used several hours to resolve this problem. By the way, the conda installation failed with conda install econ-ark, and according to the anaconda cloud, it has changed to conda install -c conda-forge econ-ark, which the conda-forge is an additional channel for conda installation and some community developed packages has been moved there and removed from the default channels.

However, when I tried today by removing econ-ark and reinstalling it, both pip install econ-ark and conda install -c conda-forge econ-ark directly gives the folder name in site-packages with upper case letters, so there are no ModuleNotFoundError.

And yes, I have just upgraded to Catalina yesterday. Catalina has moved my anaconda (and some other stuff) out of the previous folder and I have to reinstall anaconda, which leads to the loss of all environments and caused lot of troubles. I cannot remember exactly what I have done yesterday before and after solving this problem, so I suppose that the package is alright, but something was wrong with my local machine (maybe a restart after upgrading to Catalina solves some problem). But in case this happens, changing the name of the folder to upper case letters works well.

Sorry for taking your time with a misreported issue.

llorracc commented 5 years ago

@JackShiqiLi,

Thanks for this detailed followup. I'm glad that it worked when you uninstalled and reinstalled it the problem was fixed.

But, I don't think this was a misreported issue -- if this happened to you it likely will happen to someone else. I'm guessing that it really does have to do with MacOS Catalina's subtle change in treatment of case sensitivity; so other people are likely to have the same problem when they upgrade to Catalina, and because you posted this issue they may be able to quickly diagnose and fix the problem.

By the way, the conda installation failed with conda install econ-ark

Is there somewhere on the site where we incorrectly tell people that the way to install via conda is through conda install econ-ark? My message above in response to yours does have the right syntax (which you discovered by googling), but if you originally used the wrong command because you got it from somewhere in our instructions, we need to find that and fix it.

Thanks again.

JackShiqiLi commented 5 years ago

@llorracc,

Yes, it happens here at the markdown file in HARK repo, https://github.com/econ-ark/HARK, the install part says

Install from Anaconda Cloud by running: conda install econ-ark Install from PyPi by running: pip install econ-ark

I am not sure about other places, but I think this is important as it is the mostly used repo.

MridulS commented 5 years ago

Regarding conda install, yes we should change it conda install -c conda-forge econ-ark as by just putting conda install econ-ark we are assuming that people have the Conda-forge channel setup in their installation of conda.

Regarding the capitalisation issue, Mac OS Catalina could be the issue (https://www.anaconda.com/how-to-restore-anaconda-after-macos-catalina-update/) but I can't really think why the upper case problem occurred. I will look into this to make sure this has a permanent fix. [I haven't upgraded to Catalina yet, will try to get reproduce this problem]

MridulS commented 4 years ago

upgraded to Catalina and looks like it is working now? @JackShiqiLi does this still break for you?

JackShiqiLi commented 4 years ago

No, this has been solved long time ago, and I have tried to completely reinstall anaconda and the whole thing, it worked well. I forgot to report this. I think something on my local machine might have been messed up during the upgrading process. I will close this issue, thank you very much.