AdventureData / radicl

Command line interface & API for using the Lyte probe. Users can take measurements, configure and update the probe with this software
https://adventuredata.com/
Other
3 stars 0 forks source link

Improve Documentation for installing on Windows and other Python details #11

Closed crpierce03 closed 3 years ago

crpierce03 commented 3 years ago

Description

I am attempting to install radicl using pip, using windows command line - pip install radicl

The installation appears to proceed, then I receive the following error:

ERROR: Command errored out with exit status 1: command: 'C:\Users\crpie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\crpie\AppData\Local\Temp\pip-install-ee8634on\matplotlib\setup.py'"'"'; file='"'"'C:\Users\crpie\AppData\Local\Temp\pip-install-ee8634on\matplotlib\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 'C:\Users\crpie\AppData\Local\Temp\pip-pip-egg-info-_x4fgp_s' cwd: C:\Users\crpie\AppData\Local\Temp\pip-install-ee8634on\matplotlib\ Complete output (47 lines):

Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [3.0.2]
                python: yes [3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020,
                        15:57:54) [MSC v.1924 64 bit (AMD64)]]
              platform: yes [win32]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
      install_requires: yes [handled by setuptools]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype
                        (freetype2\ft2build.h) could not be found.  You may
                        need to install the development package.]
                   png: no  [The C/C++ header for png (png.h) could not be
                        found.  You may need to install the development
                        package.]
                 qhull: yes [pkg-config information for 'libqhull' could not
                        be found. Using local copy.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: no  [skipping due to configuration]
        toolkits_tests: no  [skipping due to configuration]

OPTIONAL BACKEND EXTENSIONS
                   agg: yes [installing]
                 tkagg: yes [installing; run-time loading from Python Tcl /
                        Tk]
                macosx: no  [Mac OS-X only]
             windowing: yes [installing]

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

============================================================================
                        * The following required packages can not be built:
                        * freetype, png
                        * Please check http://gnuwin32.sourceforge.net/packa
                        * ges/freetype.htm for instructions to install
                        * freetype
                        * Please check http://gnuwin32.sourceforge.net/packa
                        * ges/libpng.htm for instructions to install png
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I believe I installed freetype and png correctly. When I go into python from command line, I attempted to append the folder containing these dependencies to sys.path using the following commands:

import sys sys.path.append("C:\Program Files (x86)\GnuWin32\lib")

That appears to work during a single session of Python. But when I quit Python and go back in, this folder is no longer in my sys.path list.

micahjohnson150 commented 3 years ago

Thanks for posting this up, it helps a ton. This is a matplotlib issue.

As you mentioned over the phone it is a issue with FreeType and PNG. If you remember how you attempted to install those, I would attempt to uninstall them.

Next use this link and download your version of each lib you need. https://www.lfd.uci.edu/~gohlke/pythonlibs/

I think you will want these ones from the link above:

Give that a try and see what happens.

crpierce03 commented 3 years ago

I was able to uninstall Freetype and png. I downloaded the links you suggested. Now when I execute "pip list" I can see both freetype and pypng listed - I assume that means they are installed. When I try to install radicl again, I get the same error as before.

micahjohnson150 commented 3 years ago

Glad you were able uninstall it.

Do a pip --version and post the output here. Mostly looking for the python version that it is associated to Do the same with pip list

If the python version is not 3.8 we may need to do pip3.8 install radicl

I am thinking you are accidentally using the wrong pip since you have multiple pythons.

crpierce03 commented 3 years ago

C:\Users\crpie>pip --version pip 20.2.1 from C:\Users\crpie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip (python 3.8)

C:\Users\crpie>pip list Package Version


appdirs 1.4.4 certifi 2020.6.20 cycler 0.10.0 distlib 0.3.1 filelock 3.0.12 freetype-py 2.2.0 kiwisolver 1.2.0 matplotlib 3.3.0 numpy 1.19.1 Pillow 7.2.0 pip 20.2.1 pipenv 2020.6.2 pyparsing 2.4.7 pypng 0.0.20 python-dateutil 2.8.1 six 1.15.0 virtualenv 20.0.30 virtualenv-clone 0.5.4 wheel 0.34.2

micahjohnson150 commented 3 years ago

Ok looks like we have the right python. So are you getting the error when you install radicl, or when you run it? Based on this I am thinking when you are installing it?

crpierce03 commented 3 years ago

Correct - I am getting an identical error message to the original post when I run "pip install radicl"

micahjohnson150 commented 3 years ago

Hmmm, lets try pip install matplotlib==3.0.2

crpierce03 commented 3 years ago

Do you want me to uninstall current version of matplotlib first?

micahjohnson150 commented 3 years ago

You can but this should do it for you.

crpierce03 commented 3 years ago

Same error....

C:\Users\crpie>pip install matplotlib==3.0.2 Collecting matplotlib==3.0.2 Using cached matplotlib-3.0.2.tar.gz (36.5 MB) ERROR: Command errored out with exit status 1: command: 'C:\Users\crpie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\crpie\AppData\Local\Temp\pip-install-742o1tgq\matplotlib\setup.py'"'"'; file='"'"'C:\Users\crpie\AppData\Local\Temp\pip-install-742o1tgq\matplotlib\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 'C:\Users\crpie\AppData\Local\Temp\pip-pip-egg-info-jbsuxgum' cwd: C:\Users\crpie\AppData\Local\Temp\pip-install-742o1tgq\matplotlib\ Complete output (47 lines):

Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [3.0.2]
                python: yes [3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020,
                        15:57:54) [MSC v.1924 64 bit (AMD64)]]
              platform: yes [win32]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.19.1]
      install_requires: yes [handled by setuptools]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype
                        (freetype2\ft2build.h) could not be found.  You may
                        need to install the development package.]
                   png: no  [The C/C++ header for png (png.h) could not be
                        found.  You may need to install the development
                        package.]
                 qhull: yes [pkg-config information for 'libqhull' could not
                        be found. Using local copy.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: no  [skipping due to configuration]
        toolkits_tests: no  [skipping due to configuration]

OPTIONAL BACKEND EXTENSIONS
                   agg: yes [installing]
                 tkagg: yes [installing; run-time loading from Python Tcl /
                        Tk]
                macosx: no  [Mac OS-X only]
             windowing: yes [installing]

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

============================================================================
                        * The following required packages can not be built:
                        * freetype, png
                        * Please check http://gnuwin32.sourceforge.net/packa
                        * ges/freetype.htm for instructions to install
                        * freetype
                        * Please check http://gnuwin32.sourceforge.net/packa
                        * ges/libpng.htm for instructions to install png
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

micahjohnson150 commented 3 years ago

This is all in powershell or cmd or something else?

crpierce03 commented 3 years ago

cmd. I can try in powershell if you think it'll help.

micahjohnson150 commented 3 years ago

It might.

But outside of that everything I am reading is saying use conda. Which is weird since I run windows ten with it installed and I definitely didn't use conda when I set it up.

crpierce03 commented 3 years ago

I just tried in powershell. No change.

crpierce03 commented 3 years ago

I was able to install conda, I think. It is in there when I run pip list. But when I try to run conda, it gives me the following error:

'conda' is not recognized as an internal or external command, operable program or batch file.

micahjohnson150 commented 3 years ago

Not sure about the conda deal. I will have to do some more investigating on that front. Which version of windows are you running?

crpierce03 commented 3 years ago

Windows 10

micahjohnson150 commented 3 years ago

Me too. So I have been using python3.6 but just upgrade to 3.8 for this. I am now getting the same error! Give me a minute to poke around and see whats up.

micahjohnson150 commented 3 years ago

try pip install matplotlib only and let me know if that works.

crpierce03 commented 3 years ago

I think I did that earlier today and it didn't work. but i'll try again.

crpierce03 commented 3 years ago

Yea - matplotlib installs ok with that command (3.3.0). But then when I go to pip install radicl, I get the same error

micahjohnson150 commented 3 years ago

right. Ok so thats what happened to me. Since I have been using radicl on 3.6 so long I have missed some dependency items for 3.8. Basically the dependencies are out of alignment. Give me a few minutes to push an update to radicl with new versions.

crpierce03 commented 3 years ago

Cool. Always fun trying to keep up!

micahjohnson150 commented 3 years ago

Ok give it a try now.

I think we will still have a bit of work to do to get drivers in place but I am double checking some of that right now

crpierce03 commented 3 years ago

That seemed to work. I got a couple of warnings, which I think I could get rid of by appending my sys.path?

WARNING: The script humanfriendly.exe is installed in 'C:\Users\crpie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script coloredlogs.exe is installed in 'C:\Users\crpie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts lyte_hi_res.exe, plot_hi_res.exe, plotlyte.exe and radicl.exe are installed in 'C:\Users\crpie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

crpierce03 commented 3 years ago

When I type "radicl" into command prompt, I still get the following:

'radicl' is not recognized as an internal or external command, operable program or batch file.

I also tried to run radicl.exe from the start menu - nothing happens.

micahjohnson150 commented 3 years ago

When you ran the python install, do you remember if you check the box that says add to path?

You can rerun the installer doing a repair and checking that box if you didn't

crpierce03 commented 3 years ago

I was able to reinstall and check that box, which seemed to get rid of the warnings.

I still don’t seem able to run radicl. When I try to run from cmd, I get the following message:

“'radicl' is not recognized as an internal or external command, operable program or batch file.”

From: Micah Johnsonmailto:notifications@github.com Sent: Saturday, August 8, 2020 1:51 PM To: AdventureData/radiclmailto:radicl@noreply.github.com Cc: Pierce, Christophermailto:christopherpierce3@montana.edu; Authormailto:author@noreply.github.com Subject: Re: [AdventureData/radicl] Issue with Windows installation (#11)

When you ran the python install, do you remember if you check the box that says add to path?

You can rerun the installer doing a repair and checking that box if you didn't

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdventureData/radicl/issues/11#issuecomment-670967309, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOYWQOM26OA32637EHZGXM3R7WUDZANCNFSM4PXBCQXA.

micahjohnson150 commented 3 years ago

In both CMD and powershell? Once you install with the checked boxes and reinstall python you will have to rerun the pip install radicl.

micahjohnson150 commented 3 years ago

In powershell mine is installed as radicl.exe

crpierce03 commented 3 years ago

Got it…. Duh.

It seems to work now. I don’t have the probe with me at the moment, but I’ll be in the office later today and can try it out. Now when I try to run radicl, the application opens in command line and it seems to be searching for the probe’s COM port.

Maybe first hurdle overcome!

-Chris

From: Micah Johnsonmailto:notifications@github.com Sent: Tuesday, August 11, 2020 9:05 AM To: AdventureData/radiclmailto:radicl@noreply.github.com Cc: Pierce, Christophermailto:christopherpierce3@montana.edu; Authormailto:author@noreply.github.com Subject: Re: [AdventureData/radicl] Issue with Windows installation (#11)

In powershell mine is installed as radicl.exe

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdventureData/radicl/issues/11#issuecomment-672002180, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOYWQOKZFG7TOZMD4SIF62TSAFM5LANCNFSM4PXBCQXA.

micahjohnson150 commented 3 years ago

Sound like it!! We will need to install some drivers for you for it to see them but I think you have beaten the first beast.

Could you write up a couple things here that were confusing, misleading or not as clear in the docs, then I will add them in. I have a few things I am going to add but I want to hear what would have been nice for you to have seen.

crpierce03 commented 3 years ago

Yea I can do that.

I’ll get into the office in a bit here and can see where we get on step 2.

From: Micah Johnsonmailto:notifications@github.com Sent: Tuesday, August 11, 2020 9:26 AM To: AdventureData/radiclmailto:radicl@noreply.github.com Cc: Pierce, Christophermailto:christopherpierce3@montana.edu; Authormailto:author@noreply.github.com Subject: Re: [AdventureData/radicl] Issue with Windows installation (#11)

Sound like it!! We will need to install some drivers for you for it to see them but I think you have beaten the first beast.

Could you write up a couple things here that were confusing, misleading or not as clear in the docs, then I will add them in. I have a few things I am going to add but I want to hear what would have been nice for you to have seen.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdventureData/radicl/issues/11#issuecomment-672015583, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOYWQOOBTQEFZGV5Z3QRRF3SAFPLVANCNFSM4PXBCQXA.

micahjohnson150 commented 3 years ago

Ultimately what happened here was a lack of documentation on the installation process / wrong target audience. And not being up to date with python 3.8. Thanks @crpierce03 for his feedback below on how it could be improved.

1.      I think you need to write this in a more step by step fashion, tailored to a user of intermediate technical skills. Right now it definitely looks like it’s written more for a developer.

2.      Don't assume they have dependencies installed. List minimum requirements (by OS if necessary) and provide instructions on how to check and/or obtain those dependencies before going into how to install. For example:

a.      Python - how to check Python version and upgrade if necessary. And if necessary how to check for multiple versions and avoid using the wrong instance

b.      Pip - how to check and install if necessary. I did not have pip installed on my machine when I started.

c.      Matplotlib - explicitly state what version(s) are compatible and how to check

3.      Include Driver installation instructions (again, step by step).

4.      I think some kind of "getting started" guide would be useful. Just some basic pointers on the features of the software and how to use the various functionality.
micahjohnson150 commented 3 years ago

We also need at least some documentation on the windows drivers side of things.