quovadis
I am working with Linux MINT 19 XFCE as a VM within MS HyperV 2016.  when I attempt to run the ./start_ openplc.sh I get the following:

Traceback (most recent call last):
File 'webserver.py", line 13 in <module>
import flask
ImportError: No module named flask

So since I am a noob with this, what am I doing wrong? and what am I missing to resolve this issue.  Thank you.

PS I searched the forum to see if someone else had the same issue, if  i missed it I will apologize ahead of time for being as blind as a seven eyed bat.
Quote 0 0
thiagoralves
How did you install openplc? Did you run the ./ install.sh linux script? This error means that some components required for OpenPLC weren't installed, or maybe that your python path is messed up
Quote 0 0
TrevorM
I was also getting this issue, so I installed the module through pip. But now I am getting a new error:

Traceback (most recent call last):
File "webserver.py", line 341, in <module>
@login_manager.request_loader
AttributeError: 'LoginManager' object has no attribute 'request_loader'
Quote 0 0
thiagoralves
OpenPLC should install all the modules automatically through the installer script. Again, how did you install OpenPLC? Post your install log here from the beginning. 
Quote 0 0
TrevorM

I don't have it readily available unless there's a log stored somewhere after it completes. But I solved the issue. Just kinda brute forced my way through it, reinstalled python, upgraded stuff, and moved directories.

Edit: okay disreagard the above statement. It's back to its old ways....

I have the install log now though.
Quote 0 0
thiagoralves
You got two errors right at the beginning:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

These are related to apt-get. It could be that something else was using apt-get at the moment. If apt-get was busy, essential packages were not installed.
Quote 0 0
TrevorM
Alright, here's a fresh install without that pesky issue.
Quote 0 0
thiagoralves
From the logs it looks like it was installed properly. Are you still facing the same error?
Quote 0 0
TrevorM
From the logs it looks like it was installed properly. Are you still facing the same error?


I am. What version of python is OpenPLC supposed to use? I noticed I have 3 different versions. 
Quote 0 0
thiagoralves
TrevorM wrote:


I am. What version of python is OpenPLC supposed to use? I noticed I have 3 different versions. 

This can definitely cause problems. When you pip install something, its hard to know to which version of python it is actually installing the modules to. OpenPLC uses python 2.7, but I believe it should be compatible with 3.0 as well. You just need to have all the modules installed.
Quote 0 0
TrevorM
Okay, maybe I am just clueless, but from the log it looks like it's using Python 3.5 unless it's just using 3.5 to set things up.
Quote 0 0
TrevorM
Okay, I got it working. The issue was that python 2.7 didn't have flask or flask-login.

I still don't know why installing flask and flask login through pip commands originally changed the error message, implying that it was using flask from another version of python. Does the app even try to use other versions of python if it doesn't find what it needs in one version?
Quote 0 0
thiagoralves
The app doesn’t look for which python to use, your environment does. Usually there is one python installation that is set as the default, and that’s the one that is used to launch any python application.
Quote 0 0
Rickard
Hello! I had related python issues when installing. I solved it but I still thought i should post here, for documentations sake.
This all applies to windows 10.
I had a python 3.7 installation from before and i also had a few python-related environment variables set as is commonly recomended when running python on windows. I had python37-32\scripts\ on environment variable path and the installer calls PIP without full path, so the finished installation missed some libraries (flask, wx...) in the  local python installation. But thanks for the extra libraries now on my system python :-P

This looks like a lovely project so far and I cant wait to get into it more!
Quote 0 0
CameronNelson
Hi
I am still having a problem as I have Python 3.7.
I have installed the flask and flask login.

Please help
Quote 0 0