I'm having some trouble running the ./make command in my debian command line to install python 2.7.2.
I untarred my download from Python.org and ran ./configure which appeared to have worked fine. Unfortunately when I type in ./make I get the following error:
./make: No such file or directory
Not sure why this occurs, but I'd like to get an updated version of python to continue learning the language.
Thanks for your help,
Andy
When you type ./configure, it runs a executable script in the current directory (labeled with a .) called configure.
Make is an executable file, usually located somewhere like /usr/bin, which uses a file in the directory to run a bunch of commands depending on whether files are up to date.
When you just type make, your shell (the program that handles all your commands and sends their output to the terminal) will go looking through all the directories in the PATH environment variable to find an executable file called make, and run the first one it finds. But, when you type ./make, you're actually telling it to try and run an executable file in the current directory, called make. (It uses this approach, not searching the PATH variable, whenever you put a / in the command.)
You can use the . anywhere you could use a normal directory to specify the same directory, so for example: /usr/bin/././././ is the same as: /usr/bin. Similarly, you can use .. to specify the directory above, so /usr/bin/../bin/../bin/../lib is the same as /usr/lib.
So, after running the configure script located in ./, which generates a so-called makefile, you run the system wide version of make, located where ever, by just typing make, which uses the makefile to build the package.
Also, you can use the which command to find out where the command that'll run when you enter a command by itself - for example, which make.
(Apologies if any of this is condescending, I was going for completism. Also, I may have overused the code tags...)
its not ./make
try
"make"
as it is
Related
I have a problem when calling programs inside a python script. The programs that are giving me problems are those that I have installed manually on my computer and then added them to path on .bashrc file. The programs that where installed using 'sudo apt-get install some_program' don't give me any problem
The programs where added to my .bashrc file as the following way:
#path to fastqc
export PATH=$PATH:/home/bioinfor3/bin/FastQC/
#path to fastx-toolkits
export PATH=$PATH:/home/bioinfor3/bin/fastx/
Inside my PyCharm, I am using the os module to call those programs the in the below manner:
os.system('fastqc seq.fastq')
And I get this error
sh: 1: fastqc: not found
I guess it has something to do with the sh path or something, but I am not able to make it work
EDIT:
If Pycharm is launched from the terminal, it inherits the bashrc file with my personal paths and it works
Presumably this is happening because you have modified your login environment to adjust your PATH, but this updated path isn't seen by the shell that's running PyCharm, or PyCharm appears to be nullifying it somehow.
You should first of all verify that
os.system('/home/bioinfor3/bin/FastQC/fastqc seq.fastq')
operates as you would expect (no reason why it shouldn't, but worth checking).
It seems from this answer that by default PyCharm doesn't use bash for its shell but tcsh. Therefore it isn't seeing the setting you are enforcing on bash.
I am new to MAC OS, and I need to install a library in Python called btmorph.
In order to install it, I have to write these commands in the terminal:
git clone https://bitbucket.org/btorb/btmorph.git
cd btmorph
export PYTHONPATH=$(pwd):$PYTHONPATH
and then they said:
The above commands will temporarily set your $PYTHONPATH. Add the appropriate path in your .bashrc to make add the package permanently.
the first commands were executed successfully, but the last one is asking for PYTHONPATH which I don't know, and I am not sure if I want to change it permanently!
and then to test it I have to write:
nosetests -v --nocapture tests/structs_test.py
nosetests -v --nocapture tests/stats_test.py
I am sorry but I am a beginner in MAC.
Thank you very much.
To install a python library that does not have a setup.py file, the location of the library's root directory needs to be appended to the $PYTHONPATH environment variable for Python to be able to locate it. This is what the third command export PYTHONPATH=$(pwd):$PYTHONPATH does on a temporary basis.
To do it more permanently, that line, or more specifically, a similar one, needs to find its way into one of the files that the bash shell loads every time a new Terminal window is opened. ~/.bashrc is one of these files but ~/.bash_profile is another, and one that is arguably the better choice for a simple install on Mac OS X.
For the btmorph example specifically, there is a one-liner that can get the job done for you. I've tested it myself here, and so long as you have all of btmorph's dependencies installed, python should load the library with no problem.
If you have already executed the first two commands you listed, you should already be inside the directory into which you cloned the btmorph source code. On a default Terminal session, your prompt should read something like Maestros-Mac:btmorph TheMaestro$. If it does, you're ready to go. (You can also use the pwd or print working directory command to see the full path to your current directory)
Copying the following command and pasting it in your Terminal window will write the correct line to your .bash_profile file (or create the file and write the line to it if it doesn't already exist) and then load that file.
echo \export PYTHONPATH=$PYTHONPATH:$PWD>>~/.bash_profile && source ~/.bash_profile
Once you have run this command, you should be able to import btmorph from within a Python interpreter, and the change should persist over time.
Keep in mind that since the location of the btmorph folder where you created it has been hardcoded into the $PYTHONPATH variable (that's what the $PWD part of the command does), you cannot move the btmorph folder from where it is now, or Python won't be able to find it anymore. If you want to store the folder somewhere else, I would cd to that folder and git clone it in there to start with.
I am trying to install Django by using a tutorial.(tutorial.)
I download the latest release (1.6.2) and untar(unzip) it.
Then I open the file that contains Django on my Desktop and copy the Directory.
I open the command prompt.
From C:\Users\Name\Desktop> I type cd and I paste the Directory.
This opens the Django directory which is C:\Users\Name\Desktop\Django-1.6.2
Inside this file there is a setup.py file.
According to the tutorial if I type python setup.py install it will install Django for me! And this actually happens in the tutorial video but not in my case!!!
When I type it gives me the following:
'python' is not recognized as an internal or external command, operable program or batch file.
If I go into the Django file and Double-click the setup.py file I momentarily see in the window (before it closes) error: no commands supplied
What must I do? I am trying to install Django for 2 days now and it is getting really frustrating.
SOLVED
Must set Path Variable from Environmental Variables FIRST!
For a quick solution, look at the answer + this post and choose melhosseiny's answer.
Use the command C:\Python27\python setup.py install
Additionally, if you don't want to add C:\Python27\ to all of your python commands, you need to add it to your Windows Path. This can be done by going to your environment variables and add C:\Python27 (notice the lack of a trailing slash) to the PATH variable. Make sure you are adding to, not replacing, the values there are present.
Say I want to run an executable with a filename argument that is within my working directory, in Windows cmd I would go:
C:\Python27\python signalme.py
How can I do so in Cygwin? NOTE: C:\Python27\python is an executable. Please give me a full answer, I read somewhere here that you should add a .\a, but I couldn't know where to add it.
Cygwin attempts to make a Linux-like user environment available on Windows. To run a executable file on a Linux-like command line, you need the following things:
You have to be able to find the executable, which means one of the following:
The executable is in a directory that is included in your PATH environment variable.
You know the explicit absolute path to the executable, which you can specify at the command line
You know the relative path from the current directory to the executable, which you can specify at the command line.
The file has to have the executable permission set for the user you're attempting to use to run that file.
So, to run an executable in your working directory, you can specify the relative path to the working directory, along with the filename: ./foo.exe.
In your case, you want to use the Python interpreter to run a local Python file. You will most likely need to use the Cygwin-installed Python. That Python will probably be in your PATH, so just run:
python signalme.py
This could fail, with an error message like bash: python: command not found - in which case you should re-run your Cygwin setup, look for the opportunity to install Python, and make sure you install it.
/cygdrive/c/python27/python.exe signalme.py
I am using command prompt to run CUDA on windows. When i open cmd, the current directory is pointed towards home folder. When i type nvcc, output is nvcc : fatal error : No input files specified. It means i can run nvcc with a file. But, when i type python, it shows
'python' is not recognized as an internal or external command,
operable program or batch file.
I need to change my directory to run python.
My question is, how to make python run without changing the directory? Is it like inputting cmd about change in the library path as in ubuntu?
Windows, like Ubuntu, has the concept of a "path", which is a list of directories that the shell will search to try to find the command you typed. Therefore, the nvcc command is probably located in a directory found in your system's path, but the python command is not.
Therefore, you'll need to find where on your system the python command is, and put that command's directory into the path. So, if python is located at C:\Python26\python.exe, you will need to add C:\Python26 into the path.
Superuser has some answers that can describe how to modify the path in windows, or otherwise you can google how to do this. The exact steps may be different depending on the version of Windows that you have.
Additionally, you can also ignore the path and run the python command using the full filename. Instead of typing python, you would type (using the above example) C:\Python26\python. This would have the same effect, although would be a bit more typing.