Installing Django Error - python

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.

Related

Run python module commands on Windows

I installed Sphinx using pip install sphinx command in Windows Terminal and I want to run sphinx-quickstart to make documentation in my docs directory but it doesn't work.
I get this error instead:
sphinx-quickstart : The term 'sphinx-quickstart' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
If I try to run it via GitBash or using py or python at the beginning that says:
\path_to_python\python.exe: can't open file '\My_working_directory\docs\sphinx-quickstart': [Errno 2] No such file or directory
How can I solve this problem?
The easiest way to do it is to create simple virtual environment and you will able to install packages you want and run it.
Just create folder and run command to create virtual environment then just activate it using .bat file.
Read the docs but it can differ in future versions of Python.

Why can't I install my distribution into a local copy of python?

I've prepared a module that's ready to be uploaded to PyPI, the folder 'nester' has all the necessary components. Equipped with the build, dist, MANIFEST, and the two python files (setup.py and nester.py). Whenever I go to admin PowerShell I try running the final command to download it onto my local python file.
python.exe setup.py install
it spits back out 'permission denied', am I putting in the wrong command? the textbook I'm working from is working on terminal while I'm on Windows. The aforementioned textbook inputs
Sudo python3 setup.py install
and it seems to work perfectly for him 😒
here's what happens every time I try to run it
This likely happens, as the installer is trying to write into C:\Program Files directory. Ordinary user accounts do not have permission to do so, as the error Access Denied says.
/In *nix systems, sudo is used to act as root, and root can do anything. Thus permissions aren't an issue in the book sample.)
To illustrate your Windows case, see the image below. In the first case, ordinary user is trying to create test.txt into C:\Program Files. It fails, as expected. The second case does the same, but this time Command Prompt is started with administrative privileges.
As for a fix, you need to run the command in elevated command prompt. The prompt should have window title Administrator: Command Prompt, not C:\Windows\system32\cmd.exe.

Pip Python Installation Issues

I'm pretty new to the community, and new to python. I know the basics. But now I'm trying to download third party modules via pip but everything I do regarding pip displays an error. I know that pip comes with python seeing as the pip file is there.
I am running python 3.6 and windows 10. I have downloaded pip off the internet also but when I try to run the program it says already downloaded. The first time I ran it it said that it was downloading and successfully downloaded so I'm kind of lost.
Thanks!
Sounds like it's already properly installed. pip is a program called from a system terminal, not from a Python prompt. Open up a command prompt and type pip -h see what happens. If this does not print out the help page on how to use pip, and instead you get an error to the effect of:
"pip" is not recognized as an internal or external command, operable program or batch file
You then need to point Windows where to find the program (pip.exe) by adding your Python scripts folder C:\...\Python36-32\Scripts\ to your environment PATH variable. To do this, open the Start menu and search for "environment variables". Open the dialogue and find one named PATH (case doesn't matter). If it doesn't exist, create it. Edit the value and add the file path to the scripts folder to the end using ; as a separator.
As per your comment, if you are getting an access denied windows error this answer from another question may help you.
You need need to be sure either your powershell is being run as administrator, or by creating a virtual environment.
The Installing Packages docs have a great overview, and instructions.
https://packaging.python.org/installing/#use-pip-for-installing

Python where do I run this from?

I'm trying to use clarifai with python, I've installed the package using pip, but then it says (here) to get started by configuration as follows.
Configuration
The client uses CLARIFAI_APP_ID and CLARIFAI_APP_SECRET for authentication and token generation. You can get those values from https://developer.clarifai.com and then run:
$ clarifai config
CLARIFAI_APP_ID: []: ************************************YQEd
CLARIFAI_APP_SECRET: []: ************************************gCqT
The config will be stored under ~/.clarifai/config for client's use
But I do not understand where I "run" this from and do i need the "$". I've tried running it from python command prompt and windows command terminal but it just gives errors.
I have a Python27/scripts folder, in this I have a file caled 'clarifai' but with unknow extension i.e. I dont know if its a .py file or .exe file, I have no idea. If I open that file in notepad it reads
""" the clarifai command line utility,
Basically it helps to setup the environmental variables for the
API Clients """
So this is exactly what I want to do set the 'environmental variables' CLARIFAI_APP_ID: and CLARIFAI_APP_SECRET: but i have no idea how to do this. I tried to run this in the windows command terminal and in the python terminal but get errors both times.
someone suggested below "You should probably run in the folder you installed it to". But I did not install this, pip installed this I I dont understand where it installed it to?
Where should do you think they are implying I run this from?
You do not need the $. You should probably run in the folder you installed it to, provided you didn't add to %PATH% yet. If you did, anywhere should be fine. Windows CMD or PowerShell is probably what they want.

Installing python 2.7.2 on Debian 5.0

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

Categories