I am new to python, and trying to set up my environment to start python builds. I am using Atom as an editor. What all should I do? Through some online tutorials, I got these recommendations, but I still get some errors when I open up a python project
Installed python
Installed pip
In Atom, installed the following packages:
linter
linter-flake8
linter-ui-default
busy-signal
intentions
I get this error:
Flake8 crashed!
linter-flake8:: Flake8 threw an error related to:
Failed to spawn command flake8. Make sure flake8 is installed and on your PATH
Please check Atom's Console for more details
Setting up Atom as an IDE might not be in your best interests to learn python.
Python is a scripting language. Pip is a package manager. Atom is a code editor. All you need now is the command line to bring all of them together.
Open your terminal and cd (change directory) to the location where your file is saved. Run it using the command "python file_name.py" on the terminal.
If you have imported a package in your script that isn't installed on your machine, simply execute "pip install package_name" on the terminal.
Happy programming!
PRO Tips :: If you learn to use vi or vim you can remove Atom from your list of tools. Also, might be a good idea to learn about virtualenv to keep your system sane.
The error already tells you what is wrong.
As per the documentation for linter-flake8: To use this plugin flake8 will need to be installed on your system.
With regard to installing software, it is generally helpful to put your operating system in the tags. Installing stuff on ms-windows is different from Linux or other UNIX-like operating systems.
search for script package and install it.
You can run the code by using ctrl+shift+b
The good thing about script package is you can run any code e.g. filename.c, filename.py etc.
Related
For test purposes,
I tried to install Blender as a Python module in a virtual environment with Python 3.7 to be sure that i can use bpy.
I follow this page for the installation (https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule)
I would like at the end, when I wrote a Python script who used blender command to be able to run outside Blender software and to get information when my script finish
So I have multiples questions:
I don't really understand this line of command for Windows and how I can adapt to my virtual environment :
xcopy /E bin\2.81 C:\Python37\2.81
I can't use 'import bpy' command even when I successfully do pip install bpy in the command line ?
For my final goal project, I'm afraid that it's impossible to do because I couldn't find examples or questions related to my project.
Can someone could explain a little if it's possible or interesting to use Blender externally ?
I have recently started learning python using code academy and today I downloaded everything that I thought I would use. I downloaded Python and Atom. I have two separate drives on my computer. An SSD with not much storage and a hard drive with a lot of storage. My Windows is installed on the SSD, but I wanted to download python and atom on the hard drive, so I did so. When I installed Python I made sure to check add to PATH and the environmental variable thing. Now when I go to the command prompt, it shows "C:\Users\Gustavo>" but my python is installed on a different drive. Is there a way I could make this work? Thanks a lot.
There are two ways to install python:
Download directly from the website
Use a package manager
Case 1: Download directly from the website
Go to the python's website to download the version you would like to use.
Install the downloaded file (During the installation you can customize the installation directory)
Make sure to enable "Add python.exe to Path"
After installation has been completed, open your command prompt and type where python. Your python directory should be printed.
If all is good, then typing python should launch python in your command prompt. You can also run python by cd in the directory where your python is located and launch the .exe
You have mentioned about changing path and environmental variables, and that's probably for the purpose of keeping multiple versions of python. If that's the case, there's actually a quick fix for this:
Go to the folder where you installed Python.
Copy the python.exe file, and rename that copy in the same directory as python3.exe (If you installed version 2, then rename as python2.exe).
Now in command prompt type python2 or python3 and you should be able to launch either versions respectively.
Note: If you face issues regarding paths, then you should detail the error messages.
Case 2: Use a package manager
Choose a package manger: chocolatey, scoop, and others.
Check out these links for changing package manager's installation directory, installation method varies by the managers, so you should consult the developers should you experience problems:
chocolatey
scoop
Package managers will manage the versions for you, if you choose to install multiple versions. You should refer to the package manager's website for detailed information. However, you can quickly check the installed version by typing python --version. The python version number should be printed back to you, same applies to python3.
Double check your installation directory by which python
Type python or python3 to run your python of choice.
Lastly, you have mentioned atom. Atom is just a text editor: you can write python codes with it.
When you are done editing, you can open the command prompt and navigate to where your code resides, and type
python filename.py
This will run your code directly from the command prompt. There are many atom plugins available to make this process seamlessly integrated within atom. iPython and Jupyter plugins are first things that comes to my mind, you should specifically check out Hydrogen.
Trying to install Python 3.4.3 64-Bit and it gives me the following error:
'There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support or package vendor'
I have no bloody idea what this means so please help. Thanks in advance
I'm the admin on my computer and have all permissions
My windows is 64bit and is Windows 8.1
I had the same phenomenon occur when trying to clean up (uninstall various versions of Python and perform a clean install of 3.4.3) on my Windows 7 64-bit laptop. Unfortunately, I cannot tell you what "program required for this install to complete could not be run". Repeated attempts to "install for all users" produced the same "could not be run" (followed by a roll back of the install). Just before getting out Orca and diving into the innards of the MSI file, I attempted an "install just for me", and the install completed. I am, in fact, the only (human) user of this computer. There is another user account that was created during a cygwin setup, and access to some aspect of that user's profile/resources may have been the issue. If you are installing Python for your own use - and not as a "platform-wide" resource for other users as well - you might try installing "just for me".
For me the problem was that I had an older version of Python installed, that the MSI could not un-install. I had to manually remove it first.
This is how I resolved the problem on my Windows7 machine...
Open a command prompt and navigate to the location of the python.exe. (For me this was C:\Python34.)
Execute this command
python3 -B -m ensurepip._uninstall
Close the command prompt.
Using the python MSI file for the version of Python I had previously installed (yes, I went to the Python archive and downloaded the MSI for the old version), install Python again, but without the "pip" package. (Not sure if this is necessary, but it worked for me.)
Using the same Python MSI file, uninstall Python completely.
Using another MSI, for the version of Python you wish to install, you should now be able to perform a "clean" install.
I got the same error while uninstalling the python file from the control panel. It prompts
There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support or package vendor
I have solved this problem by installing the specific python-<version>.amd64.msi.
I then executed the MSI file. It asks for Change, repair, remove. First, click on Change radio button and complete execution. Later you can come to control panel and repair or uninstall the python file.
I had the same symptoms as OP. In my case, i had two separate installs, one of 2.7 and one of 3.4.3 and when i checked the PATH variable, there were 2 lines about PYTHONPATH pointing to the 2.7 version.
I removed the lines and then the repair funciton of the MSI did work. I uninstalled both versions and proceeded to reinstall.
Done :)
On a Win7 box:
Startup/ right click on Computer / Properties / Advanced system settings / Environment variables then check both sub-windows for paths related to python.
I had just the exact problem. But in mine case i've additionally removed the c:\python27 and c:\python36 directories and associated installers got stuck around Install/Uninstall and could not completely repair the installation (the /Scripts subdirectory has been missed and the python.exe reported an error about missed encodings module).
But i've found a solution for myself. Seems somehow the PYTHONHOME and PYTHONPATH environment variables (and may be PATH too) has been interfering with the Python installation process. But because i could not run Uninstall from the Windows Uninstall list in the Control Panel, then i did this:
Cleanup the PATH environment variable from all python path occurrences.
Remove PYTHONHOME and PYTHONPATH environment variables.
Restart Windows Explorer if environment variables (console command set PY must return the empty list) is not updated.
Run repair from (!) the python-3.4.4*.exe/python-2.7.11*.exe executables (download it if not done yet). Icons in the Windows Uninstall list in the Control Panel will reset into the original state for a repaired python installation.
Run the Uninstall from the same executables or from Windows Uninstall list in the Control Panel.
And it did the trick!
If you still needs the both versions of the python installation, then try install the older versions before the new versions. Seems it's important too.
Poking around, there is a temp file saying:
Error 1721. There is a problem with this Windows Installer package. A
program required for this install to complete could not be run.
Contact your support personnel or package vendor. Action: UpdatePip,
location: C:\Programs\PY272\python.exe, command: -m ensurepip -U
--default-pip
=== Logging stopped: 6/12/2015 13:26:17 ===
OK, so the missing "Voldemort" file (that which shall not be mentioned) is the ensurepip package. There is documentation for ensurepip at https://docs.python.org/2/library/ensurepip.html. I am still on 2.7, but it looks like this is a shared problem with Py 3.
The documentation says the ensurepip package is new in 2.7.9. My solution: install a version prior to 2.7.9 and then upgrade the files myself from an existing install. Done.
I am trying to install Sublime Text 2 on my linux machine and I cannot figure out how to run the python script to install it. I am fairly new to linux and never programmed in python before. I am trying to run the python script PackageSetup.py using ./PackageSetup.py but i get the error:
bash: ./PackageSetup.py: python: bad interpreter: No such file or directory
not sure what I have to do. I have python on my machine. I can tell cause running 'python' puts me in the console.
For all I know this kind of issue can occur if you have a misspelling or mistake in the shebang. I see two ways to solve this issue: you can try to invoke PackageSetup.py via python, like python PackageSetup.py or you can open PackageSetup.py and try to find an issue in the shebang, maybe it needs to be a full path to python interpreter like /usr/bin/python not just python.
BTW, why don't you try to install it via some kind of package manager - there is a repo for debian-based distros, and I'm pretty sure that there have to be repositories for other distributives.
I have a problem with the following command:
setup.py install.
I know it should work, I have tried it on a laptop but I don't have access to it at the moment. I need to complete a homework so I tried the same on my PC. And when I type the same command into cmd it just runs pyscripter as if I would use right click on setup.py and click edit with pyscripter. It does nothing else. I am sure that I am in the right folder in cmd.
My python version is 2.7 and my pyscripter version is v2.5.3. My OS is win7. I have tried to install other modules but I get the same response.
Has anyone encountered the same problem? I have searched the internet but I haven't found any answers to this problem.
Assuming that you installed Python 2.7 in the default folder i.e. c:\python27, then you can type:
c:\python27\python setup.py install
Wherever you installed it, you should append that path to your PATH variable (you'll need to log on as an admin to do that).
Do python setup.py install instead.
Windows is probably not set up to recognize .py files as executable.
Recently our class at school used all of the above programs. about a handful of students had trouble installing like you described. Fortunally I didnt not have this problen but I can suggest you use Administration priviledges.
Make sure you download the correct version.
Go to your download folder and look at the file you have downloaded (do this via my computer not from your web browser)
Right click on the file and then click run as an administrator
Here is an awesome site for windows binaries: http://www.lfd.uci.edu/~gohlke/pythonlibs/
If the library you need is there, just download and install like any other windows program...