![]() ![]() Weirdly, the path '/opt/ros/kinetic/lib/python2.7/dist-packages' is already in there, but it is /usr/lib/python2.7/dist-packages that contains catkin_pkg and some other important packages and modules. But it doesn't seem to work like that, or at least simply adding python paths to. My logic was that if I simply add all python directories, version 2.x and 3.x, to my PYTHONPATH, then any application (such as ROS) can always find the right modules it needs. bashrc because of syntax errors in all files with python 2 syntax. I tried to simply add /usr/lib/python2.7/ to my ~/.bashrc, but that doesn't work. This is my default python version: $ python -VĪnd my sys.path: $ python -c 'import sys print(sys.path)' Is that possible? If yes, how do I do that? I want to make it so that ROS uses python 2.7, but I want to keep python 3.6 as my default python version. How can I run ROS (Kinetic in my case) when my default python version is 3.x? The suggestions in the other questions don't help me, as this is about a more general problem: Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH. ![]() When I run catkin_make, I get an error that has been described in a few other questions here (such as here and here): ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg' So, you need to install the compiler version that corresponds to your Python version : Distutils notes If the package's setup. CPython 2.7 uses Visual C++ 9.0, CPython 3.3 uses Visual C++ 10.0, etc). ![]() ![]() Though this will also require tracking which one I'm using now.The default python version I use on my Ubuntu 16.04 machine is 3.6 (Anaconda) and I'm trying to setup my catkin workspace. Each Python version uses a specific compiler version (e.g. Has anyone found a good compromise for this? I'm thinking of going back to the homebrew version for general use, and writing an alias for changing the path back to the conda version as necessary. I looked at ways of building it, but creating a recipe takes a lot of effort (create YAML file, etc.) There are Python 3.6, Python 3.7, and Python 3.8 metapackages available with this release, so you can work with Anaconda in other versions of Python as you wish. One package I was using with django was "markdown_deux", which is not available in the Conda repo. I tried to create conda environments from the requirements.txt file. anaconda2 4.3.0 (Default): Anaconda a package manager, an environment manager, a Python 2.7 distribution, and a collection of over 1,000+ open source. None of my virtualenvs work, since apparently one's not supposed to use conda and virtualenv together. Conda is great for numerical computing, because I can install Jupyter/Numpy/Pandas in the root environment, and not have to bother install virtualenvs for every project.īut now my entire web development workflow is messed up. I removed the Homebrew version and the download (kept the main system one). I decided to unify all of this, and use conda. System/Library/Frameworks/amework/Versions/Current/bin/python Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, Oct 19 2015, 18:31:17)Īnaconda is brought to you by Continuum Analytics.Ĭame with the downloaded. The good news is that the libraries I needed can now work with the 2.7 version smoothly and Visual Studio 2015 automagically detected my new Python environment. Due to dependencies in libraries that I want to work with, I had to have the 2.7 version installed as well. Python 2.7.10 (default, Jul 13 2015, 12:05:58) 14 I was using the Anaconda 3.5 distro in a Windows 10 machine. Once you have VSC installed, open VSC and install the Python extension and the Pylance extension (if they’re not already installed). When installing Visual Studio Code (VSC), you can keep all the default settings. See Install Python interpreters ) Each environment is composed of the specific Python interpreter, its standard library, a set of pre-installed packages, and any other packages you install while that environment is activated. I checked the number of Python installations I had on my laptop recently, and was shocked to find four: Came with Mac OS X: Install Visual Studio Code and Anaconda To start, download and install Visual Studio Code. For example, Python 2.7, Python 3.6, Python 3.7, Anaconda 4.4.0, and so on. I use Python extensively on my Mac OS X, for both numerical applications and web development (roughly equally). Python 2.7 is scheduled to be the last major version in the 2.x series before it moves into an extended maintenance period. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |