dpeerlab / Palantir

Single cell trajectory detection
https://palantir.readthedocs.io
GNU General Public License v2.0
203 stars 45 forks source link

Cannot install and run Palantir on Jupyter notebook #132

Closed andrewsong777 closed 5 months ago

andrewsong777 commented 5 months ago

I installed Palantir into my Jupyter notebook but am getting errors as below.

Screenshot 2024-02-08 at 6 31 14 PM
katosh commented 5 months ago

Hello @andrewsong777,

Thank you for reporting the issue you've encountered. We have reviewed the details, and it's worth noting that the import error you're experiencing is not one that we can reproduce in our continuous integration (CI) testing environment, where the palantir package is routinely installed and tested across various setups.

Since the package is functioning as expected in our controlled tests, the issue might be specific to your local environment. A common cause for such import problems could be related to the PYTHONPATH environment variable or a possible corruption in your local installation.

Here are a few steps you can take to potentially resolve this:

  1. PYTHONPATH: Ensure that your PYTHONPATH environment varibale is not set, or is correctly set to include the directory where the palantir package is installed.

  2. Corrupted Installation: Try reinstalling the package. If you're using pip, you can do this via pip uninstall palantir followed by pip install palantir.

  3. Jupyter Kernel: Make sure to restart your Jupyter kernel after making changes to the environment or reinstalling packages.

If these steps do not resolve the issue, we recommend seeking assistance through community forums or Stack Overflow where the collective experience of the community often provides valuable troubleshooting insights.

katosh commented 5 months ago

I looked at your error message again and noticed one potential source of error: Your Palantir directory /Users/ajong/anaconda3/lib.python3.11/site-packages/palantir contains a directory core. Hence, the import statement in the utils.py script searches this directory. However, the Palantir source directory does not contain a subdirectory called core and instead the import statement from .core import run_palantir is supposed to search the core.py script. I do not know how this additional subdirectory got tehre in your case but I would recommend removing it and reinstalling Palantir to fix the issue.

Please let me know if this worked!

andrewsong777 commented 5 months ago

thank you, it worked!