While running doxygen, "sh: doxypy: command not found" error is coming - python

I have installed doxygen 1.8.8 on my linux machine, and trying to run doxypy but seeing issue with it
[nipatel#caspgval4 docs]$ doxygen --version
1.8.8
[nipatel#caspgval4 docs]$ whereis doxypy
doxypy: /usr/bin/doxypy.py
[nipatel#caspgval4 docs]$ which doxypy
doxypy: Command not found.
While running doxygen, I see following error:
Reading /mypath/myfile.py...
sh: doxypy: command not found
PATH on the machine:
echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/bin/doxypy.py
Can someone let me know if I am missing anything here? How can I make doxypy command work? Do I need to add any PATH or something?

I suggest to not rename doxypy.py to doxypy.
Create a symbolic link: ln -s /usr/bin/doxypy.py /usr/bin/doxypy

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:
[root#server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
If it's empty, You may set the PATH variable with this command
export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

I renamed /usr/bin/doxypy.py to /usr/bin/doxypy and it resolved the issue.

Related

-bash: source: filename argument required

I'm working through a Python tutorial, and I attempted to pip install autoenv==1.0.0. I created the .env file in the dir
source env/bin/activate
export APP_SETTINGS="config.DevelopmentConfig"
and then ran these commands in the shell, outside of a venv
echo "source `which activate.sh`" >> ~/.bashrc
source ~/.bashrc
I got back:
-bash: source: filename argument required
source: usage: source filename [arguments]
Come to find out, autoenv failed to install. I was able to get it to install and re-ran the above commands and now it works but I'm still getting the above message whenever I reload the terminal
How can I find and remove the source command or resolve it?
** edit: running which activate returns
23:24 $ which activate.sh
/usr/local/bin/activate.sh
I've looked in .bash_profile and can't find anything that seems related.
I've looked in the .bashrc file and found a path to activate.sh, though the path has the file located in the bin which it is not.
After running
grep source ~/.bash
suggested by Cyrus above, I found 3 random "Source" commands, after deleting them, the issue went away.
Thanks, Cyrus and Mihir for your help.

Why this error when I try to create workspaces in ROS?

Whenever I try to create a workspace:
~/catkin_ws$ catkin_make
It shows like this:
ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/usuario/miniconda3/bin/python
"/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
"/opt/ros/kinetic/share/catkin/cmake/../package.xml"
"/home/usuario/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
returned error code 1
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
/opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
/opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:52 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/usuario/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/usuario/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
It seems like there is a problem with catkin_pkg but I dont find the solution
I just installed ROS on Ubuntu 16.04, had the same issue, and fixed it. The location for catkin_pkg is likely not on your PYTHONPATH and needs to be added.
From the error output:
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
Try locating catkin_pkg and check your PYTHONPATH. catkin_pkg wasn't on my PYTHONPATH (likely due to other program installs), so I added it and ran catkin_make again, this time successfully.
~/catkin_ws$ locate catkin_pkg
/usr/lib/python2.7/dist-packages/catkin_pkg
~/catkin_ws$ echo $PYTHONPATH
/opt/ros/kinetic/lib/python2.7/dist-packages
To append the catkin_pkg dir to PYTHONPATH (for this session):
~/catkin_ws$ export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
For permanency I appended the catkin_pkg dir to PYTHONPATH in my .bashrc (you might want to backup your .bashrc file first, e.g. cp -p ~/.bashrc ~/.bashrc-ros-catkin.bak).
To do this, edit your ~/.bashrc file (you might need to use sudo to edit this file) and add the following two lines to the end of the file:
# manually added for ROS catkin_make workspace setup
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
Save the file and run source to update your session:
~/catkin_ws$ source ~/.bashrc
Check your PYTHONPATH again:
~/catkin_ws$ echo $PYTHONPATH
/opt/ros/kinetic/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages
Obviously the location of your catkin_pkg files might be different to mine, so use that path instead when appending to $PYTHONPATH above.
Now try running catkin_make again. If you get the same error, paste the output of your catkin_pkg location and PYTHONPATH here.
Cheers,
sb
Are you using Anaconda environment?
This issue is quite common with Anaconda's Python installation.
Try: python --version
If you see Anaconda in the output, go to your bashrc file with vi ~/.bashrc and then comment the line where anaconda is added to path.
It would be something like,
export PATH="username/anaconda2/bin:$PATH"
After that source your bashrc with source ~/.bashrc, open a new terminal and navigate to your catkin workspace. Delete the old build folder and try the catkin_make command again.
Should solve your issue.
The Error Output:
ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
As mentioned above you need have "catkin_pkg" in PYTHONPATH. The easiest way if you ask me is:
$ pip install catkin_pkg
try this : pip install -U rosdep rosinstall_generator wstool rosinstall six vcstools
if pip shows any errror, switch to root and install pip and then try
Actually when you want to use Anaconda and ROS simultaneously then generally this error comes. So firstly go in .bashrc file and comment the path of anaconda.
Export PATH="/home/gaurav/anaconda3/bin:$PATH".
After commenting go in catkin_ws folder and delete the existing folder within the folder and make new src folder.
Then follow three steps:
1 - $ mkdir src
2 - $ catkin_init_workspace src
3 - $ catkin_make
It works for me.
This means you havent sourced ROS into your environment.
Add this line to the last line of your .bashrc file
source /opt/ros/kinetic/setup.bash
Save the .bashrc file, close the current terminal and start your process in a new terminal.
for me, it fixed by
sudo apt-get remove python3-catkin-tools
sudo apt-get install python-catkin-tools

Calling 'make' from Python inside Vagrant VM

Okay, so this question is very project-specific, but it's a problem for me nonetheless.
I have a Python/django website, hosted on localhost from an Ubuntu VM set up by Vagrant. From this website I want to paste in C code and compile it via a series of Python functions. In one of these functions I call make like this:
arg2 = os.path.join(Default_SDK_PATH, "examples/peripheral/blinky")
arg4 = os.path.join(Default_SDK_PATH, "examples/peripheral/blinky/makefile")
args = ' '.join(['make', '-C', arg2, '-f', arg4])
p = subprocess.Popen(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True
)
output, errors = p.communicate()
p.wait()
I specify arg2 and arg4 more for testing than anything else - It's just to be 100% sure that the correct makefile is used.
### ### ###
OK!
So my problem comes when the subprocess runs. The makefile is called with make, but failes. When I check the build log I can see the error message arm-none-eabi-gcc: error: nano.specs: No such file or directory.
When I call vagrant up for the first time a file named bootstrap.sh is called. I've tried adding new commands to this file
sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi
sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi=4.9.3.2015q1-0trusty13
to uninstall Ubuntu's original GCC and install the latest GCC toolchain. No success there either. I've also tried returning the whole filestructure to file just to check if the files in question exists, and they do!
Can anyone point me in the right direction here?
Thanks in advance.
Whoop-di-hoo, I solved it!
I don't exactly know why, but sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi doesn't seem to do anything, so the original GCC-files still exist when I try to install the new GCC.
Also, the new GCC is installed in /usr/bin, while the old GCC has it's own specified folder.
So I edited my Makefile to get arm-none-eabi-gcc-4.9.3 from /usr/bin instead of the old arm-none-eabi-gcc. nano.specs is now included, and life is great!

CMD in Windows 7 does not execute command (Python Django)

Ok people at this link for pysec as the technical solution is explained we have some code that you must type to the command prompt (i think because it has a dollar sign in front):
$ cd ~/path/to/pysec && python -c "import sqlite3; sqlite3.connect('edgar.db')"
$ mv ./local-settings-example.py ./local-settings.py
$ mkdir ./pysec/data
However whenever i go to C:\Python27\pysec-master which is the location where the pysec file is stored (according to instructions) and type these commands exactly as i see them i get that the system cannot find the path specified.
Like this
C:\Python27\pysec-master>cd ~/path/to/pysec && python -c
cmd response --> The system cannot find the path specified.
C:\Python27\pysec-master>cd ~/path/to/pysec && python -c "import sqlite3; sqlite3.connect('edgar.db')"
cmd response --> The system cannot find the path specified.
C:\Python27\pysec-master>mv ./local-settings-example.py ./local-settings.py
cmd response --> 'mv' is not recognized as an internal or external command, operable program or batch file.
C:\Python27\pysec-master>mkdir ./pysec/data
cmd response --> The syntax of the command is incorrect.
What seems to be the problem? Don't you have to type these commands in the cmd since they have a dollar sign?
ANSWER FOR THIS QUESTION IS PROVIDED FROM THE COMMENTS UNDER THE QUESTION BY USER Stephan
I decided to put the all together in on place>
cd ~..., mv .` and mkdir .\ looks more like unix syntax than windows-cmd. cd and mkdir work on both platforms, but with different syntax. The cmd-version of mv is move.(ANSWER)
also /path/to/pysec tells you, that you should put in the path to pysec, not the string "\path\to\pysec"(ANSWER)
Can we transform these commands to Windows syntax?(QUESTION)
Should we put the path to pysec like this: C:\Python27\pysec-master i mean the full or absolute as it is called path? Because it that tutorial I can see that the example is trimmed as cd ~/path/to/pysec`(QUESTION)
the tilde (~) has a special meaning in unix. I don't speak unix, but I think it means "Systemdrive". The CMD command would be: cd /d "c:\Python27\pysec-master" (in CMD use \, in unix it's /). Instead of mv use move (ANSWER)
Only the third command does not seem to work mkdir ./pysec/data well I think there muse be something different for windows (QUESTION)
mkdir .\pysec\data ... You remember? "in CMD use \, in unix it's /"(ANSWER)
THANK YOU FOR THE SUPPORT

workon command not found when using fabric

My fabric file:
def deploy():
code_path = 'mysite/public_html/mysite'
with cd(code_path):
with prefix("workon mysite"):
run('git pull')
run('supervisorctl -c ~/supervisord.conf restart ' + env.host_string)
I get the following error:
Aborting.
[myserv] out: /bin/bash: workon: command not found
Obviously workon command works when I do this manually (without fabric). I suspect /usr/local/bin/virtualenvwrapper.sh is not being sourced (it normally gets run through .bash_profile).
What do I need to do to get workon command working?
Try modifying your prefix with:
with prefix(". /usr/local/bin/virtualenvwrapper.sh; workon mysite"):
you have to copy this virtualwrapper load code from .bashrc to .bash_profile file or if not exist create new .bash_profile file and copy there.
code to copy::
export WORKON_HOME=/home/virtual
source /usr/local/bin/virtualenvwrapper.sh
this error happen because .bashrc is only read by a shell that's both interactive and non-login. So in this case it is not interactive non-login shell, so it won't work. so we have to copy those code to .bash_profile file.
reference link
I use pyenv with plugin pyenv-virtualenvwrapper. I had no success with workon, instead I use this (fabric 2.5):
with c.prefix('source /home/mirek/.virtualenvs/%s/bin/activate' % PROJECT):
with c.prefix('cd /home/mirek/dj/%s/%s' % (PROJECT, PROJECT)):
c.run('python manage.py ....')

Categories