OpenEIS with VOLTTRON - volttron

When trying to use OpenEIS in VOLTTRON, I first need to install OpenEIS.
I managed to install Python 3.4, so I can run "python3 bootstrap.py" under ~/openeis-2.x
I managed to change the get-pip link in bootstrap to https://bootstrap.pypa.io/get-pip.py
However, when I ran the command, I got a series of error messages, the first two I am trying to overcome is "import pip ImportError: No module named 'pip' " and import ensurepip ImportError: No module named 'ensurepip'"
Isn't the purpose of downlaoding get-pip from the link, so I don't need to have pip and ensurepip when I run the code?
Thanks.

OpenEIS and VOLTTRON use two different versions of python. The get-pip script is specific to VOLTTRON as it is necessary for the 2.7 version of python in order to install pip. With OpenEIS pip is already installed so it shouldn't need to get-pip.
In order to get OpenEIS and VOLTTRON working you first need to get them installed separately. Once you have them running then you can use the OpenEISHistorian from VOLTTRON to send data to the OpenEIS instance.
I hope that helps and clears up some of the confusion that you are having.

Related

lmfit packages conflicting in Windows 10 using Anaconda Python 3.7

I'm trying to use a curve fitting package (lmfit) I did use several times in former times with Python 2.7. Since I moved to Python 3.7, I'm facing some problems on running my script. The error message I get is "ModuleNotFoundError: No module named 'lmfit'".
If I try to reinstall/update the package (using whatever of the commands in https://anaconda.org/conda-forge/lmfit): it looks like there are conflicting packages in my pc. Here the screen of my prompt:
prompt after using 'conda install -c conda-forge/label/cf202003 lmfit'
Any hints on how to solve this conflict?
just install with pip install lmfit.

Terminal issues error message that no Django module "models" exists, but it is in the directory

I'm a motivated beginner working my way through Python Crash Course. I created a project and an app using Django. I'm unable to get the python manage.py run server command to work. This is the header of the long error message:
"Watching for file changes with StatReloader
Exception in thread Django-main-thread".
The middle includes several lines of "".
At the end, it says "from models import Activity"
"ModuleNotFoundError: No module named 'models''
There IS a module named models in the directory. This is my second exercise using Django, and the program worked earlier. I've searched the net and read everything remotely similar, but have been unable to find a solution. How can I make the program recognize a module that is there?
I think the problem was that the version of pip in the virtual environment was the python 2.7 version instead of the 3.9 version I used to create the project. It had to be upgraded using:
python3 -m pip install --upgrade pip
I also used python3 for the manage.py runserver command instead of just python.

tcms-api 5.3 package incompatible with Windows

I attempted to upgrade my tcms-api library from 5.0 to 5.3 using:
pip install tcms-api --upgrade
on a Windows 10 machine, I saw a lot of errors when trying to install the dependent package of kerberos. Even though this is old, I saw a similar set of errors. The package installation failed since the kerberos package isn't supported on Windows and I was left at tcms-api 5.0.
Please file a bug against https://github.com/kiwitcms/tcms-api.
We can do a quick fix by providing 2 package names:
tcms-api and tcms-api[kerberos]
The first one will not install the kerberos package.
The proposed workaround makes sense but changing the underlying kerberos implementation needs careful testing which isn't a quick job.
OTOH https://github.com/kiwitcms/python-social-auth-kerberos uses gssapi which seems to be the latest and most actively maintained implementation of Kerberos for Python. There is an open issue to migrate to that in tcms-api so you can contribute if you want.
As a workaround, I was able to do the following (caveat: I haven't extensively tested my installation yet):
Clone the tcms-api repo from GitHub
Edit setup.py to change the install_requires line to use 'kerberos-sspi' rather than 'kerberos'
Install the following pip packages: Setuptools, Wheel, Twine
CD to repo folder and run: python setup.py bdist_wheel
That creates a package under the dist folder
Run pip install dist\tcms_api-5.3-py3-none-any.whl
Celebrate successful package install
The steps were modified from this page.
Update:
I confirmed the things I need the API to do work with my custom package (create and update test runs). However, I'm in a situation where I don't need to specifically harden my Kiwi instance using kerberos authentication.

ModuleNotFoundError in Spyder

I tried to import the biopython package in Spyder and got the error message:
ModuleNotFoundError: No module named 'biopython'
although biopython is installed.
I also checked the PYTHONPATH: there is a path set into the directory where the packages are stored.
Can somebody help? Did I miss something? Thanks for your help!
If you're using Anaconda, it's best to install all the packages you want from Anaconda if possible. You can check if a package is available with (e.g.):
conda search biopython
When I try that command it shows that biopython is available, so assuming you have access to the standard conda channels you should be able to get it this way.
Assuming you haven't already created a conda environment to work with, start by creating a new one with the packages you want to use:
conda create -n myenvname spyder biopython
where myenvname is the name you want to give the environment - call it whatever you like. If you want to use other packages as well, add their names to the end of this command. Then once the env is completed, activate it:
activate myenvname
or if this doesn't work, on Mac or Linux:
source activate myenvname
and start Spyder in this environment:
spyder
Each time you want to use this environment in future you will need to activate it first. You may also be able to do some of these tasks through the Anaconda Navigator or via Start menu shortcuts but the command line version will always work.
If there's a package you want that isn't available from conda but is available via pip, just use the pip command after creating and activating the environment.
If you are using Anaconda, a solution could be
conda install -c main biopython
following https://anaconda.org/main/biopython.
The official repository page helped me when I got your error message because numpy was not in place.

Installation error numpy in Qpython

In Qpython which uses Python 2.7.2; I can't install the numpy module. The message I get is: command python setup.py egg_info failed with error code 2
I think it tries to install the Mac version***, which is obviously not compatible. At least, that's what it looked like when scrolling through the CLI output when issuing the pip install numpy command using the pip script.
I don't think the numpy/scipy modules are available for Qpython for Android. I think we're just going to have to wait. I've been googling this same question and I have not found an answer.
***Ok, the script says it's a version for a variety of OS', just not Android. I have no idea why pip install would download it if it wasn't compatible. It doesn't make sense, so I'm obviously missing something.

Resources