# About the Python path in the package

**URL:** https://discourse.julialang.org/t/about-the-python-path-in-the-package/20072
**Category:** New to Julia
**Tags:** package, control
**Created:** [January 25, 2019, 5:24am UTC](https://discourse.julialang.org/t/about-the-python-path-in-the-package/20072 "2019-01-25T05:24:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![johnysy](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@johnysy](https://discourse.julialang.org/u/johnysy)
#### Post date: [January 25, 2019, 5:24am UTC](https://discourse.julialang.org/t/about-the-python-path-in-the-package/20072/1 "2019-01-25T05:24:22Z")

</div>

I am using MichiganAutonomousVehicles package. I have successfully installed it. But I am now facing the problem when using MichiganAutonomousVehicles.

ERROR: InitError: PyError (PyImport\_ImportModule

The Python package rospy could not be found by pyimport. Usually this means  
that you did not install rospy in the Python version being used by PyCall.

PyCall is currently configured to use the Python version at:

/usr/bin/python3

and you should use whatever mechanism you usually use (apt-get, pip, conda,  
etcetera) to install the Python package containing the rospy module.

One alternative is to re-configure PyCall to use a different Python  
version on your system: set ENV[“PYTHON”] to the path/name of the python  
executable you want to use, run Pkg.build(“PyCall”), and re-launch Julia.

Another alternative is to configure PyCall to use a Julia-specific Python  
distribution via the Conda.jl package (which installs a private Anaconda  
Python distribution), which has the advantage that packages can be installed  
and kept up-to-date via Julia. As explained in the PyCall documentation,  
set ENV[“PYTHON”]=“”, run Pkg.build(“PyCall”), and re-launch Julia. Then,  
To install the rospy module, you can use `pyimport_conda("rospy", PKG)`,  
where PKG is the Anaconda package the contains the module rospy,  
or alternatively you can use the Conda package directly (via  
`using Conda` followed by `Conda.add` etcetera).

I met this problem in Windows and I can’t fix by downloading Anaconda.

---

<div class="post-metadata">

### Author: ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)
#### Post date: [January 25, 2019, 7:40am UTC](https://discourse.julialang.org/t/about-the-python-path-in-the-package/20072/2 "2019-01-25T07:40:30Z")

</div>

Do you install `rospy`? What is the Python executable in which you can import `rospy`? Looking at [melodic/Installation - ROS Wiki](http://wiki.ros.org/melodic/Installation), [python path issues with rospy · Issue #8 · JuliaMPC/MichiganAutonomousVehicles.jl · GitHub](https://github.com/JuliaMPC/MichiganAutonomousVehicles.jl/issues/8), [How to run ROS if your default python version is 3.x via Anaconda - ROS Answers: Open Source Q&A Forum](https://answers.ros.org/question/259437/how-to-run-ros-if-your-default-python-version-is-3x-via-anaconda/), etc., it looks like `rospy` is required to be installed in a non-standard way.

---

<div class="post-metadata">

### Author: ![johnysy](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@johnysy](https://discourse.julialang.org/u/johnysy)
#### Post date: [January 29, 2019, 1:32am UTC](https://discourse.julialang.org/t/about-the-python-path-in-the-package/20072/3 "2019-01-29T01:32:13Z")

</div>

I installed it and there’s no problem now! Thank you!
