AguaClara / aguaclara

An open-source Python package for designing and performing research on AguaClara water treatment plants.
https://aguaclara.github.io/aguaclara/
MIT License
24 stars 13 forks source link

Errors in using package #102

Closed juanchon998 closed 5 years ago

juanchon998 commented 5 years ago

Hello team (@oliver-leung ?)

I'm trying to see if I can use the new LFOM code in python to generate an LFOM design instead of using the Mathcad. I am trying to modernize!

However I am running into problems that are presumably associated with the import. I can't seem to import any packages:

image

I have version 0.0.14 of the aguaclara package installed. I have just now installed and updated it using pip uninstall aguaclara and pip install aguaclara. I still could not get imports to work, so I went to where the package files are stored locally and pip install .-ed. image

I have python version 3.6.5 image

Is there something simple I'm missing? Thanks in advance

fletchapin commented 5 years ago

@juanchon998 I ran into almost the same problem last week when I was debugging the test cases. I don't think it's a bug with the package but how you're calling the import statement and where the kernel exactly is being run from.

With that being said unfortunately I don't have an immediate answer for you on how to fix this since it's very dependent on your environment. When I just did pip install -e . from the top level of the master branch and then tried the import statement you showed it worked.

The only advice I have is to make sure to restart your kernel before testing the import statement because the kernel takes the state of the packages when it's created and is not dynamically updated. So for example if you reinstall the package after the kernel has been started the kernel will NOT change accordingly. If this issue persists let me know and I can try to schedule some time to debug for your machine/environment specifically.

juanchon998 commented 5 years ago

Thanks for the help Fletcher! How do I restart my kernel? Is that what pip install -e . does?

I'll try it tomorrow and report back

fletchapin commented 5 years ago

Do CMD + SHIFT + P on Mac or CTRL + SHIFT + P on Windows in Atom then search Restart and Hydrogen’s command should appear.

Restarting Atom will also restart the kernels since Atom kills them when it closes.

fletchapin commented 5 years ago

pip install -e . installs the package at the current directory rather than the latest pip version. That way you can use the latest updates pushed to master even if they haven’t been released on pip yet

juanchon998 commented 5 years ago

I tried uninstalling the aguaclara package and reinstalling it with pip install -e . , then I restarted atom, restarted the kernel, and got the same error. I also get this error message whenever I open atom, which might have something to do with it.

image

oliver-leung commented 5 years ago

Hey @juanchon998 , were you able to resolve this error? Here is an issue for the Atom Python plugin that talks about the same error that you're getting.

Did you try running python -m pip install 'python-language-server[all]', and if so, what was the result?

juanchon998 commented 5 years ago

Thanks for following up Oliver- I checked the issue you sent and did as mzannoni suggested. I ran pip3 install --user --upgrade python-language-server[all] and got a lot of "Requirement already satisfied" text and: image

So I added that path to my PATH

image

But to no avail, alas 😢

When I run python -m pip install 'python-language-server[all]' I get this buncha red text:

image

oliver-leung commented 5 years ago

python -m pip install 'python-language-server[all] looks like it's getting a string parse error. The first line indicates that it's doubling the single quotes.

Perhaps try running

python -m pip install python-language-server

or

python -m pip install python-language-server[all]

or those commands without python -m at the beginning.

oliver-leung commented 5 years ago

Closing this as it hasn't been responded to in a while. @juanchon998 , please reopen this if necessary!