GithubHelp home page GithubHelp logo

Comments (7)

ljreder avatar ljreder commented on May 5, 2024

I use virtualenv as well and it is a known problem how to handle these. The work around however, is to set the PYTHON_BASE to your desired Python interpreter (e.g. your virtualenv one) and that will override the Makefile system set one. It becomes a little more work if your doing multiple environments.

Also you can try using virtualenvwrapper tool which allows controlling the environmental variables on a per virtual env occurance. See https://realpython.com/python-virtual-environments-a-primer/#managing-virtual-environments-with-virtualenvwrapper. I have not tried this but if it helps and works out let me know.

from fprime.

yashi avatar yashi commented on May 5, 2024

Do you have any idea about the problem we had when we just to run python, assuming that users has properly set up their environment?

from fprime.

LeStarch avatar LeStarch commented on May 5, 2024

Currently, PYTHON_BASE is embedded in our sample shell scripts. It should be fairly simple to fix this, and we have it in the works. However for the time being, setting PYTHON_BASE to your virtual environment should work. This is how I work, and it functions pretty well.

I have found a few corner cases where this does break, and fixes are underway for those too.

from fprime.

brianthespoon avatar brianthespoon commented on May 5, 2024

Any easy fix I was able to implement was to edit the "activate" script in my virtual environment "bin" with the following:
export PYTHON_BASE=$VIRTUAL_ENV

I use python virtualenv, which sets this VIRTUAL_ENV variable. I simply leverage that by setting PYTHON_BASE to it. Currently it looks like the make scripts check for PYTHON_BASE, and use a default value of "/usr" if it's not found. Perhaps it can also check for virtualenvs signature "VIRTUAL_ENV" variable?

from fprime.

LeStarch avatar LeStarch commented on May 5, 2024

Yes, I use that fix for the time-being too. I am working on patch that will remove the dependency on PYTHON_BASE. I will comment here when it is being delivered.

from fprime.

LeStarch avatar LeStarch commented on May 5, 2024

This should be fixed in the latest devel.

from fprime.

LeStarch avatar LeStarch commented on May 5, 2024

Closing.

from fprime.

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.