Giter VIP home page Giter VIP logo

Comments (4)

MarkGrayRESPEC avatar MarkGrayRESPEC commented on August 15, 2024

I see that your PATH includes an Anaconda version of Python before the OSGeo version. For this to work, it needs to only find the OSGeo Python. On my development machine for this project I have removed all other versions of Python to reduce confusion. It may be possible to keep another version, but you will have to make sure only the OSGeo version is in the PATH, PYTHONHOME, and PYTHONPATH variables. You may want to take a look at our freshly updated "Getting Started" instructions at: https://github.com/USEPA/SWMM-EPANET_User_Interface/wiki/Getting-Started-as-a-Developer
Please follow up to let us know whether you got it working and whether you have any tips on using Eclipse with this project.

from swmm-epanet_user_interface.

Techre avatar Techre commented on August 15, 2024

Hi Marc,

Thanks for the reply. Because I need Python on my machine I installed everything according to your guide on another computer, including pyCharm. When installing Qgis I had to install Tkinter as well, otherwise the code would not run.

I have the same problem.

C:\OSGeo4W64\bin\python.exe C:/Users/_/PycharmProjects/SWMM-EPANET_User_Interface/src/ui/EPANET/frmMainEPANET.py
Try loading ENOutputAPI-64.dll from C:\Users\_\PycharmProjects\SWMM-EPANET_User_Interface\src\Externals\epanet\outputapi
Loaded ENOutputAPI-64.dll: <CDLL 'C:\Users\_\PycharmProjects\SWMM-EPANET_User_Interface\src\Externals\epanet\outputapi\ENOutputAPI-64', handle 6bfc0000 at aa56588>
QGIS libraries not found, Not creating map
API 'QDate' has already been set to version 1

variables

The error is thrown by frmMain.py, line 60

from qgis.core import QgsApplication

QtCore.py, line 28

`for api in ["QDate", "QDateTime", "QString", "QTextStream", "QTime", "QUrl", "QVariant"]:
    sip.setapi(api, 2)

from swmm-epanet_user_interface.

tudorbarascu avatar tudorbarascu commented on August 15, 2024

Hi,
@MarkGrayRESPEC First of all thanks for working on this project.. can't wait on trying your Epanet/QGIS work. Thanks also for choosing QGIS/QT.

@Techre As on Windows, the OSgeo4W64 installer has its own version of PYTHON, it's clear that QGIS must load some env variables before starting. By looking how QGIS is starting (env. variables) you can see how you can solve your issue.

Basically, check what happens in bin\o4w_env.bat or in qgis.bat files and you'll figure out the solution.

For more details, take a look at https://blog.qtibia.ro/2016/06/09/how-to-setup-pycharm-for-qgis-development-under-linux-and-windows/ and see the Windows part.

You can easily keep multiple versions of Python on your machine without having problems between them. As a rule, don't make a PYTHONPATH env variable system wide, but load it with a script (.bat file) before you start your custom Python aware program. If in doubt, always do a import sys + print sys.path to see which directories are traversed by your Python executable and in which order.

Hope it helps,
Tudor

from swmm-epanet_user_interface.

Techre avatar Techre commented on August 15, 2024

Hi tudorbarascu,

Thank you for your quick reply. I think PyCharm does find the libraries now as the error is risen by "C:\OSGeo4W64\apps\qgis\python\qgis\PyQT\QtCore.py"

But I will try you solution tonight.

from swmm-epanet_user_interface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.