Coder Social home page Coder Social logo

Comments (8)

MrBean947724451 avatar MrBean947724451 commented on July 20, 2024 4

delete CMakeLists.txt which will cache make config .If the first time you use python 2.7 ,the file can remerber python path,and use it . so JUST DELETE CMAKELISTS.TXT!

from homebrew-qgisdev.

dakcarto avatar dakcarto commented on July 20, 2024

Hi @nextstopsun, thanks for reporting.

I ran into this during testing, and for me, it was because I had PYTHON... environ variables still pointing to Python 2 locations. If you have any PYTHON... environ variables, please unset them and rely upon only the python3 found on PATH, then try again.

from homebrew-qgisdev.

nextstopsun avatar nextstopsun commented on July 20, 2024

@dakcarto Larry, thanks for clarifying!

I've unset PYTHONPATH prior to installing python3. Checked env - it doesn't show anything python related.
What exact env vars should I set explicitly to make it work?

from homebrew-qgisdev.

dakcarto avatar dakcarto commented on July 20, 2024

HI @nextstopsun, please try this:

Download this gist (test-cmake-find-pyinterp.cmake):
https://gist.github.com/dakcarto/1f14287dd4d18ffc6db6ceae6ad0cab1

Then, in the same Terminal shell that you are using for brew install qgis3-dev run the following, substituting <path-to>:

cmake -DQGIS_SRC="$(brew --cache)/qgis3-dev--git" -P <path-to>/test-cmake-find-pyinterp.cmake

Then, post the CMake output from Terminal and the dump file listed after "Dumping current CMake variables to ..." at end of output (consider sanitizing the dump file prior to posting, if you are concerned with sensitive paths).

Thanks!

from homebrew-qgisdev.

nextstopsun avatar nextstopsun commented on July 20, 2024

@dakcarto Larry, thanks for your help!
test-cmake-find-pyinterp.cmake output is:

cmake -DQGIS_SRC="$(brew --cache)/qgis3-dev--git" -P /Users/nextstopsun/Work/qgis-homebrew/test-cmake-find-pyinterp.cmake
-- CMake's PythonInterp module
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.5.2", minimum required is "3") 
-- QGIS's FindPythonLibrary module
-- Found Python executable: /usr/local/bin/python3
-- Found Python version: 3.5.2
-- Found Python library: /usr/local/Frameworks/Python.framework/Versions/3.5/Python
-- Found Python site-pacakges: /usr/local/lib/python3.5/site-packages
-- CMake's PythonLibs module
-- Found PythonLibs: /usr/local/Frameworks/Python.framework/Versions/3.5/Python (found suitable version "3.5.2", minimum required is "3") 
-- Dumping current CMake variables to ...
  /Users/nextstopsun/Library/Caches/Homebrew/qgis3-dev--git/test-cmake-find-pyinterp_cmake-vars.txt

The test-cmake-find-pyinterp_cmake-vars.txt is in this gist

I can't find anything suspicious related to python 2.
Any clues?

from homebrew-qgisdev.

nextstopsun avatar nextstopsun commented on July 20, 2024

I've noticed, that though I do unset PYTHONPATH brew outputs this

HEAD is now at 08ee180 [FEATURE] cpt-city catalog support in color ramp's gradient-only mode (#3832)
Failed to import the site module
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
     PYTHONPATH is currently: "/usr/local/lib/python2.7/site-packages"
     You should `unset PYTHONPATH` to fix this.
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'

echo $PYTHONPATH returns an empty value.

from homebrew-qgisdev.

nextstopsun avatar nextstopsun commented on July 20, 2024

Setting explicitly export PYTHONPATH=/usr/local/lib/python3.5/site-packages gets the build running, but I guess this isn't a universal solution.

from homebrew-qgisdev.

dakcarto avatar dakcarto commented on July 20, 2024

@nextstopsun good to know. Thanks for the update on this. I think this is isolated to your setup, though I'm at a loss as to how PYTHONPATH is currently: "/usr/local/lib/python2.7/site-packages" is getting set (maybe in $HOME site-packages via a .pth file?).

Closing this issue, since it does not seem to be happening on other tester's environs. Please reopen if needed.

from homebrew-qgisdev.

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.