I have successfully installed s3cmd(http://s3tools.org/s3cmd) on a windows 7 machine. I first installed python 2.7
added python to my path
then ran python setup.py install
I also added the python\scripts folder to my path but I can't run s3cmd from the dos prompt by simply running s3cmd but I can run the command if I use the full path like this
> python c:\Python27\Scripts\s3cmd
My issue is that I use ruby rake to automate some tasks and it needs to run on both windows & mac, is there a way I could simply run s3cmd like I would on linux or a mac?
Thanks!!
Just in case: we built a free open-source analog s3cmdwin - a very (very!) simple command line tool to upload a file to s3 or list existing files in a bucket, based on Amazon's nuget-published SDK.
Disclaimer: I'm one of the contributors.
Type this in a s3cmd.bat (or s3cmd.cmd) in a place somewhere in your path:
python C:\Python27\Scripts\s3cmd %*
And you should be able to cast commands like s3cmd sync --etc...!
Related
After installing Google cloud sdk and connecting to desired firebase project i am receiving :
ERROR: (gsutil)
"C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe":
command not found when running any gsutil command.
My current stup is:
windows 10
Google Cloud SDK 281.0.0
bq 2.0.53
core 2020.02.14
gsutil 4.47
python 3.7
My theory is, that while installed "correctly" python doesnt have access to gsutil commands
I had the same problem and I was able to solve it by setting a new environment variable for CLOUDSDK_PYTHON. On windows 10 you can do this from the command line in 2 ways:
Set an env variable for the current terminal session
set CLOUDSDK_PYTHON="C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe"
Set a permanent env variable
setx CLOUDSDK_PYTHON="C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe"
The file path will probably be different for everyone, so check first where is python.exe located and use your own path. I hope this helps.
Run:
set CLOUDSDK_PYTHON=C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe
Note: There should be no quotes around the python path like this "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe" or it would attempt to run the command with quotes, which we know won't work.
To see a list of components that are available and currently installed, run command:
gcloud components list
To update all installed components to the latest available version(282.0) of Cloud SDK, run command:
gcloud components update
You also can reinstall it following this document, while Cloud SDK currently uses Python 2 by default, you can use an existing Python installation if necessary by unchecking the option to 'Install Bundled Python'.
As was suggested above reinstalling using bundled python worked for me. I had incorrectly assumed from google's doc i should choose between bundled or current python install not realizing both could run without conflict.
Syntax needed to be a little different for me in CMD and/or PowerShell - also I installed Python via the Microsoft Store so the command for me was:
SETX CLOUDSDK_PYTHON "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\python3.9.exe"
you can get the exact path by running the python app from the start menu and then reading the window title:
I've managed to install pymol on windows following the instructions here and using the file Pmw‑2.0.1‑py2‑none‑any.whl from here
Various folders have appeared in C:\Users\Python27\Lib\site-packages (Pmw and Pmw-2.0.1.dist-info). However, I can't actually work out how to run pymol.
It used to be provided as a .exe format which could just be run in the usual way for windows applications. The folders that have installed just contain lots of python scripts, but I can't find anything which actually launches the programme.
That's probably not the official way but it works :)
Download both the appropriate pymol and pymol-launcher file.
Install pymol via pip
change file extention of pymol-launcher to .zip (or unzip it straight)
get pymol.exe and make sure to have either pymol##.dll (## is your version number) in your path or in the same directory
Did it work for you?
I took another approach. NOTE! I am using Anaconda2 (python 2.7.13) under Windows 8.1
First download the appropriate files from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymol
Pmw-2.0.1-py2-none-any.whl
pymol-1.8.6.1-cp27-cp27m-win_am d64.whl
pymol_launcher-1.0-cp27-cp27m-win_amd64.whl
Start Command Prompt (Admin) via right-click on windows start button and navigate to your python installation directory
Enter the following lines (adapt to your installation of python)
C:\Users\David\Anaconda2>Scripts\pip.exe install Pmw-2.0.1-py2-none-any.whl
C:\Users\David\Anaconda2>Scripts\pip.exe install pymol-1.8.6.1-cp27-cp27m-win_am d64.whl
C:\Users\David\Anaconda2>Scripts\pip.exe install pymol_launcher-1.0-cp27-cp27m-win_amd64.whl
Now just launch pymol via pymol.exe that was created in the same directory.
I'm new to Linux. I recently downloaded Bash on Ubuntu on Windows 10 (after the Anniversary edition update to Windows 10). Since this update is relatively new, there is not much online regarding troubleshooting. There are two things I need help on:
(1) When I go to the home folder, which seems to be "C:\Users\user\AppData\Local\lxss\home\user" and I add a new folder through Windows, this folder does not show up in Linux with the "ls" command. But when I add a directory using "mkdir" in Linux, the "ls" command shows this folder. Why is it behaving like this? Am I limited to creating folders through "mkdir" when working in this folder?
(2) I have a Python script sitting in that same folder that I'm trying to run and again it is not being found by Linux or the Python interpreter started in Bash on Ubuntu on Windows. I have Python 3 installed (Anaconda) and I'm able to type commands directly in the Python interpreter and it's working. However, I would like to run scripts in files.
Please let me know if more information is needed. Thanks.
The reason why ls is not showing anything is that it shows the Linux directory structure. Try setting it to the Windows directory, in this example the c drive:
cd /mnt/c
Does ls show a folder structure now?
Looks like you are having permissions issues.
To see everything on your home folder try
ls -al
to change permissions check out the chmod command
How about using Python for Windows and NotePad++ to edit and run your Python scripts?
https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe
You can setup NotePad++ as described here.
How to Execute a Python File in Notepad ++?
(I ended up using Cloud9 https://c9.io/ for Python. It is independent of your local environment or OS)
I am running Ubuntu 14.04/GNOME 3.8.4 on 15 MBP Duel Boot.
I am new to Linux and Python(Pycharm ide)
I have downloaded the Pycharm "files" from the software center
but cannot run the program.The icon comes up in the side bar but when i click it nothing happens. I have tried "./" and only the code appers in "gedit" Please help Oracle java is already installed
Alternatively, after extracting your pycharm.tar.gz,
add the following in .bashrc file (which is in home folder itself, to view hidden files use ctrl+h)
alias pycharm='~/tools/pycharm-4.0.6/bin/./pycharm.sh'
OR In your case it might be,
alias pycharm='~/Downloads/pycharm-4.0.6/bin/./pycharm.sh'
And, then restart the terminal and type,
pycharm foldername
It should open the pycharm with given folder.
hi Pedro in ubuntu you need to install the files using the command prompt even if you downloaded the files you need to install them using command, unlike windows in linux when some software is downloaded you need to install them manually by using commands like sudo apt-get python install..
for further help you can consult http://linuxg.net/how-to-install-pycharm-3-4-on-ubuntu-14-04-linux-mint-17-pinguy-os-14-04-and-other-ubuntu-14-04-derivatives/
I have installed the new python release and would like to run .py files from the terminal.
How is this done from the terminal? I dont want to include the path in each command to run a .py file.
If you want to override the python command, you can set your PATH variable correctly, e.g. in your ~/.bash_profile:
export PATH=/path/to/python/:$PATH
That said, for managing different versions of components that are also provided by Mac OS X, I suggest to use a package manager such as Homebrew.
if you add a shebang at the start of the python file then you can run a python file by just its name from terminal
add #!/usr/bin/python
for mac(others add your respective path for python)
at the top of your python program and from your terminal you can run it just by filename(if it has executable permissions).
Have a look at the Python package under Applications. There is a shell script there called Update Shell Profile.command
Run this and it should set your path up properly.
Unless you mark you script as executable with chmod +x, you'll need to run python over it first. e.g. `python myscript.py'
I installed all of my python through macports, which has pros and cons. One of the benefits is that you don't have to worry about stuff like this, it just works. You can install python 2.6 and python 2.7 (and others), and then use the python_select utility to set up which python is run when you call "python blah.py"
Since you have installed a working python, the easiest way to run python files from the terminal is to cd your terminal to the directory where the file is located and then just type python my_code.py in the terminal.