4 Replies Latest reply on Apr 12, 2018 12:24 PM by gregor

    Issue with the PI Web API client library for Python: module error

    maortiz

      Hello

      I am very very new to programming. I do not know much. I am trying to install the PI WebAPI module on my computer. I am using Microsoft visual c and have Python installed via the Anaconda package.

       

      As I understand, PI WebAPI conforms to the Swagger standards and therefore one can use the Swagger wrapper to avoid having to do multiple GET statements. (I don't really even know what this means but apparently working with the swagger wrapper version is easier so I don't have to use GET all the time??)

       

      I do not have github installed on my computer and wont be able to get it. Therefore, I tried to install this by downloading the files from github and doing it manually using the SetupTools version. Apparently I already have Easy Tools on my computer. Not sure what the purpose of that is.

       

      I went to https://github.com/osimloeff/pi-web-api-client-python and I downloaded all the files.

       

      All it says on that link is:

       

      Install via Setuptools.

      python setup.py install --user

      (or sudo python setup.py install to install the package for all users)

      Then import the package:

      import osisoft.pidevclub.piwebapi

       

      I then went into my command prompt and typed in <C:AppData\Local\Continuum\anaconda3>python C:\Desktop\PI-Web-API-Client-Python-master\PI-Web-API-Client-Python-master\setup.py -install --user

       

      I don't know if this is even right...but a bunch of stuff apparently installed based on the command prompt image below.

       

      Then I try to call on the module "import PIWebApiClient" or "import osisoft.pidevclub.piwebapi" and I get errors in visual code saying that there is no module called by PIWebApiClient and no module called Osisoft

      I show another picture of this also below

       

      What am I doing wrong?

       

      Any help would be greatttttttttttttt. Thank you!

       

      I vc2.JPGvc3.JPGCMD.png

        • Re: PI API module error
          Eugene Lee

          Hi Marcos,

           

          You are missing a LOT of install steps. A proper one looks like below. Try running setup again with the anaconda prompt. And remember to run with admin permissions.

           

            • Re: PI API module error
              maortiz

              Thanks Eugene. I went into the anaconda command prompt and i get the same output.

              Below is the output... does this possible not work with anaconda because the paths are different?

               

              Thanks for any help

               

              (base) C:\Users\Marcosi7\Anaconda3>python C:\Users\Marcosi7\Desktop\PI-Web-API-Client-Python-master\PI-Web-API-Client-Python-master\setup.py install --user

              running install

              running bdist_egg

              running egg_info

              writing osisoft.pidevclub.piwebapi.egg-info\PKG-INFO

              writing dependency_links to osisoft.pidevclub.piwebapi.egg-info\dependency_links.txt

              writing requirements to osisoft.pidevclub.piwebapi.egg-info\requires.txt

              writing top-level names to osisoft.pidevclub.piwebapi.egg-info\top_level.txt

              reading manifest file 'osisoft.pidevclub.piwebapi.egg-info\SOURCES.txt'

              writing manifest file 'osisoft.pidevclub.piwebapi.egg-info\SOURCES.txt'

              installing library code to build\bdist.win-amd64\egg

              running install_lib

              warning: install_lib: 'build\lib' does not exist -- no Python modules to install

               

               

              creating build\bdist.win-amd64\egg

              creating build\bdist.win-amd64\egg\EGG-INFO

              copying osisoft.pidevclub.piwebapi.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO

              copying osisoft.pidevclub.piwebapi.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO

              copying osisoft.pidevclub.piwebapi.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO

              copying osisoft.pidevclub.piwebapi.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO

              copying osisoft.pidevclub.piwebapi.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO

              zip_safe flag not set; analyzing archive contents...

              creating 'dist\osisoft.pidevclub.piwebapi-1.1.0-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it

              removing 'build\bdist.win-amd64\egg' (and everything under it)

              Processing osisoft.pidevclub.piwebapi-1.1.0-py3.6.egg

              Removing c:\users\marcosi7\appdata\roaming\python\python36\site-packages\osisoft.pidevclub.piwebapi-1.1.0-py3.6.egg

              Copying osisoft.pidevclub.piwebapi-1.1.0-py3.6.egg to c:\users\marcosi7\appdata\roaming\python\python36\site-packages

              osisoft.pidevclub.piwebapi 1.1.0 is already the active version in easy-install.pth

               

               

              Installed c:\users\marcosi7\appdata\roaming\python\python36\site-packages\osisoft.pidevclub.piwebapi-1.1.0-py3.6.egg

              Processing dependencies for osisoft.pidevclub.piwebapi==1.1.0

              Searching for pandas==0.22.0

              Best match: pandas 0.22.0

              Adding pandas 0.22.0 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Searching for python-dateutil==2.6.1

              Best match: python-dateutil 2.6.1

              Adding python-dateutil 2.6.1 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Searching for certifi==2018.1.18

              Best match: certifi 2018.1.18

              Adding certifi 2018.1.18 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Searching for six==1.11.0

              Best match: six 1.11.0

              Adding six 1.11.0 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Searching for urllib3==1.22

              Best match: urllib3 1.22

              Adding urllib3 1.22 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Searching for numpy==1.14.0

              Best match: numpy 1.14.0

              Adding numpy 1.14.0 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Searching for pytz==2017.3

              Best match: pytz 2017.3

              Adding pytz 2017.3 to easy-install.pth file

               

               

              Using c:\users\marcosi7\anaconda3\lib\site-packages

              Finished processing dependencies for osisoft.pidevclub.piwebapi==1.1.0

            • Re: Issue with the PI Web API client library for Python: module error
              gregor

              Hi Marcos,

               

              Because there is an older Developer Technology referred to as "PI API" and your question definitely was about "PI Web API" I've changed your questions title. I've also moved your question into the appropriate space.