running jupyter-notebook from terminal calls wrong script - path

I am trying to open jupyter-notebook (Anaconda 3 distribution) from the terminal, but whether I call jupyter, jupyter-notebook, or jupyter notebook, I get an error indicating that what was actually called was C:\ProgramData\Anaconda3\Scripts\jupyter-notebook-script.py.
I have C:\ProgramData\Anaconda3\Scripts and C:\ProgramData\Anaconda3 added to PATH, so I can see that it is looking in the right directory, but matches with the wrong file.
Is the solution to add only the .exe's I want to PATH, rather than the folder? Or is there a way to add a folder to path such that only .exe's will be noticed. Or perhaps there is some way of setting the priority when the given command matches multiple entries in PATH?
Edit:
I got what I need working by reinstalling Anaconda with the 'add to PATH' option selected. However, I am still interested in WHY this issue was occurring, and posting an answer to that may be helpful for future viewers of this page.

Are you running jupyter from the Anaconda Prompt?
On Windows it's bad practice to add the variables to PATH manually to use Anaconda. You lose the entire point of Anaconda managing these things itself.
If all you want is to launch an jupyter notebook using your anaconda distribution just open the anaconda prompt (comes with the installation), make sure the jupyter package is installed and run jupyter notebook.
If that doesn't work, might be that the conda environment's path got messed up during jupyter's installation so pip uninstall jupyter then pip install jupyter from within the Anaconda Prompt.
Lastly, if you haven't already, think about using conda envionments so that you really will never have to mess with your PATH anymore.

I was able to solve this issue by reinstalling Anaconda with 'Add to PATH' selected, rather than adding to path manually.

Related

Trouble running openai gym environment on google colab

Error that I'm struggling with
I'm trying to use MarsExplorer (https://github.com/dimikout3/MarsExplorer) in google colab, but I'm struggling with properly importing it. I was able to successfully clone the repo, but when I try to run the demo mars_explorer isn't imported. How can I fix this?
Indeed #Dr.Snoopy makes a great point here. This is the line in test.py where it is expected to work:
from mars_explorer.envs.settings import DEFAULT_CONFIG as conf
Now, notice that this is being called from your runtime path, usually root in Colab's case (I suppose), then it should return an error.
Now, if installed, for instance with pip install -e you can both import the module and edit it as you go.
Check out these docs.-,6.1.2.%20The%20Module%20Search%20Path,-%C2%B6), they may be helpful to understand this error.
apply these two commands in colab cell:
!git clone https://github.com/dimikout3/GeneralExplorationPolicy.git
the above command will save GeneralExplorationPolicy folders in your colab and inside this folder you can find mars-explorer folder then make copy of the path of the mars-explorer folder for example. /content/GeneralExplorationPolicy/mars-explorer
then apply this command for install mars-explorer:
!pip install -e /content/GeneralExplorationPolicy/mars-explorer

Change where Julia is storing /logs/manifest_usage.toml

I'm getting this error when I run Julia in Docker:
julia.core.JuliaError: Exception 'SystemError: opening file "/root/.julia/logs/manifest_usage.toml": Read-only file system' occurred while calling julia code:
I tried setting JULIA_HISTORY, but that doesn't seem to be respected.
It looks like you actually probably want to move your whole .julia folder, assuming that the whole /root/ directory is probably going to give you filesystem permission errors unless you always run as root within your docker image.
You can control the location of the .julia directory at first install with the JULIA_DEPOT_PATH environment variable, which is described in a bit more detail in this answer: permissions for installing packages on julia in slurm cluster, though depending on how you are installing Julia, you may be able to more easily sidestep the whole issue by just not using sudo when installing Julia.

How do I delete a ros/gazebo-simulation completly

I have a kinda weird problem. I'm currently messing around with the VRX-Simulator, which simulates an unmanned-watersurface-vehicle.
For the installation I followed the guide on https://bitbucket.org/osrf/vrx/wiki/tutorials/SystemSetupInstall.
Then I tried to modify some of the files and tried to rebuild the project.
This was the point when I noticed it always used the "old" version of my simulation within gazebo.
From now on no matter what I did (I even deleted the whole catkin workspace folder) ROS somehow managed to always launch the original version of my simulation even without any build/src folder existing when I used roslaunch.
roslaunch vrx_gazebo sandisland.launch
So my question would be how can I get rid of my simulation/model and where does ros/gazebo cache my simulation?
You most probably installed the package with the command from the tutorial sudo apt install ros-melodic-vrx-gazebo. So the package launched with roslaunch vrx_gazebo sandisland.launch was not in your catkin workspace. If you want to get rid of it you can uninstall it with sudo apt remove ros-melodic-vrx-gazebo. But this is not strictly necessary.
There are several ways to find out where some ros package is located, try running some of these commands:
rospack find vrx_gazebo will show you where the package used is located
roscd vrx_gazebo will take you to the folder where it is installed something like
/opt/ros/melodic/share/vrx_gazebo
If you also followed the tutorials installing from source code then the issue most likely was not sourcing the built packages. The last line of the guide is a bit misleading. The line *Remember to run this command every time you open a new terminal. is meant to reference the command source ~/vrx_ws/devel/setup.bash
Whether the installed package or the package built from source is used depends on which order they are listed in the environment variable ROS_PACKAGE_PATH. This variable is modified by both source /opt/ros/melodic/setup.bash and source ~/vrx_ws/devel/setup.bash. So have a look at the variable after each step with printenv | grep ROS or echo $ROS_PACKAGE_PATH. Theoretically if you source your terminal in the order I had the source commands it should be using the package built from source, you can verify with the rospack find ... and roscd ... commands mentioned earlier.
In the end it is probably easier to add the sourcing commands to your .bashrc file so you would not forget to source the terminals as mentioned in the ROS installation tutorial. You can add the sourcing of the workspace to the the same file, you will just have to be aware that you would need to change the file, should you want to use a different workspace.
http://wiki.ros.org/melodic/Installation/Ubuntu#melodic.2BAC8-Installation.2BAC8-DebEnvironment.Environment_setup
relevant command from the tutorial:
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
you could do the same for the workspace:
echo "source ~/vrx_ws/devel/setup.bash" >> ~/.bashrc
And after running those commands run exec bash to get the changes into the current terminal. All future terminals will have those commands already loaded.

How to link handmade package with conda in a generic and clean way?

Hi
I created my own package, myOwnLib. I made a link from /path/to/anaconda3/lib/python3.7/site-packages which point to my package, following this : Anaconda: Permanently include external packages (like in PYTHONPATH).
It works perfectly when I don't activate any environment. However, When i "conda activate" an environment, I cannot access to the package anymore and receive the message :
"No module named 'myOwnLib'"
I can thus link this library with doing the same action /path/to/.conda/envs/previous/lib/python3.7/site-packages/ , but it becomes redundant.
Is there a more generic way to link modules with anaconda?
Thanks in Advance
action attempted:
1) conda develop "/path/to/lib", as suggested here : How to add folder to search path for a given Anaconda environment?
With a deeper investigation, I notice that conda develop works perfectly IF you use it outside the environnement. Being Inside one don't offer the opportunity to do global changes on How conda manage your Python libs.
Be Carefull: I notice that I cannot use conda develop without having installing pip with conda before ( conda install pip) because conda install pip seems to create lot's of files such as lib, which is needed. Otherwise, you get a message that tells you that it cannot find : path/to/your/env/lib/python3.7/site-packages/conda.pth

Setting Ros package path

I just began exploring ROS from the ros.org. I'm having some trouble setting the environment in Ubuntu. I get the following error while trying to set up a workspace automatically every time a new shell is launched.
bash: /opt/ros/fuerte/setup.bash: No such file or directory
bash: /opt/ros/fuerte/setup.bash: No such file or directory
Probably your ROS installation added this to your ~/.bashrc file and somehow the setup.bash file got (re)moved.
Try to locate that file and change the path accordingly. This should set the required enviroment variables in order to run ROS (core) etc.
Check answers.ros.org for ROS-related Q&A. The wiki is also a good source of information: www.ros.org/wiki.
First, open terminal and type the following command:
gedit .bashrc
Then press Ctrl + F and search fuerte. Delete everything about fuerte. Fuerte is old, download the new version groovy..
Check which version of ROS have you installed. There are newer versions of ROS like ROS groovy.
Probably you installed a new one, but follow the guide for the old ROS fuerte. First make sure which distro have you installed.

Resources