How do I install python app? - python

I want to install the app I found on a github page (https://github.com/googlei18n/fontview), how do I do it? I tried opening the 'build.py' file through mac terminal but it doesn't work, as well as pyton luncher- it freezes.
Kajas-MacBook-Pro:~ Kaja1$ cd fontview-master
Kajas-MacBook-Pro:fontview-master Kaja1$ cd src
Kajas-MacBook-Pro:src Kaja1$ cd fontview
Kajas-MacBook-Pro:fontview
Kaja1$ python2.7 build.py && ./build/FontView.app/Contents/MacOS/fontview
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'build.py': [Errno 2] No such file or directory

You are in the wrong directory. Change back to the folder fontview-master and run the command from there.

Related

ununderstanble ._app.py file on macos

Im deploying a flask app on a remote server
When i run my lint and test locally on my macos I have no problem.
But when i run tar -cvf project.tar myfolder then ssh into my server and run tar -xf /tmp/project.tar -C /mydeployedfolder, i have hidden .py files that crashes my lint and test.
For example i have ._app.py file with content
Mac OS X 2?
ATTR
??com.apple.lastuseddate#PScom.macromates.selectionRange
This file doesnt appear on my initial foder on my macos (either in finder or if i do cat ._app.py in terminal) . I have tried to tar and untar locally on my mac but no such files appears either.
I have tried to run cmd+shift+. to have hidden files appear but it doesnt work
I have tried to run
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
And it is the same!
I also tried Forklift (a finder replacement where you can show hidden files) and i only have ._DS_Store no hidden py files
I also tried
dot_clean mypath
find . -type f -name '._*'
But it is the same
How can i do to avoid this or delete the hidden files?

"‘python’: No such file or directory" when running Python file as executable

I have installed python and I have a file Wifite.py that exists in my current directory.
But whenever I try to run the Wifite2.py file I receive this error:
‘python’: No such file or directory
jarvus#jarvus:~/wifite2$ ls
bin PMKID.md setup.py wordlist
Dockerfile README.md tests wordlist-
EVILTWIN.md reaver-wps-fork-t6x TODO.md
LICENSE runtests.sh wifite
MANIFEST.in setup.cfg Wifite.py
jarvus#jarvus:~/wifite2$ ./Wifite.py
/usr/bin/env: ‘python’: No such file or directory
What changes should be made to get ./Wifite.py working?
The workaround I got is using:
python3 Wifite.py
But I'm looking for alternatives.
This message:
/usr/bin/env: ‘python’: No such file or directory
suggests that the hashbang in your script looks like this:
#!/usr/bin/env python
Since running the script explicitly with python3 worked OK, it sounds like you're on a distro where by default you only have python3 and no python. As other answers suggest, you may install python-is-python3 (which basically creates a python symlink pointing to python3). If you don't wish to do that, then just adjust the script's hashbang so that /usr/bin/env looks for python3:
#!/usr/bin/env python3
Seems you don't have python2 installed but only python3 but it is not registered as plain python.
Try
which python
which python2
which python3
If only the last command runs without error you can try to link python3 to python with
sudo apt-get install python-is-python3
Use shebangs!
In the first line of your script write the python interpretor path.
#! /usr/bin/python
Then chmod +x your file on shell. That will make it executable. And you can directly run it.
Try running python3 Wifite2.py from the directory where the file exists.

How to start pipenv

I have been try to my pipenv going but it gives me this error
Creating a virtualenv for this project…
Pipfile: C:\Users\User\Pipfile
Using C:/Python/Python37/python.exe (3.7.1) to create virtualenv
[ ==] Creating virtual environment...FileNotFoundError: [Errno 2] No such file or directory
'c:\\python\\python37\\Lib\\venv\\scripts\\nt\\python.exe'
Failed creating virtual environment here
I tried to changed the file path made sure it is in same path as where python is installed still get the same problem.
copy following files from python location(C:\Program Files\Python37) to the (C:\Program Files\Python37\Lib\venv\scripts\nt)
1) python_d.exe
2) python_d.pdb
3) pythonw_d.exe
4) pythonw_d.pdb
thanks this solved the problem just one question if i want to use git clone command which filepath should i used?
because if i used the git clone command in same path
C:\Users\User>git clone https://github.com/jadhavpritish/Dream11_Predictor.git
C:\Users\User>pipenv run python src/player_selection_dream11.py
C:\Users\User\.virtualenvs\User-jBUq-HwN\Scripts\python.exe: can't open file 'src/player_selection_dream11.py': [Errno 2] No such file or directory
Okay! So what I just did to resolve it is that;
This message popped up (Shortly)
[ ==] Creating virtual environment...FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\arham rumi\\appdata\\local\\programs\\python\\python37-32\\Lib\\venv\\scripts\\nt\\python.exe'
Then I went to the mentioned directory, and there was no such file like python.exe
Then I went back to python37-32 folder or you can simply go to the directory where you have that python.exe file. Copy this and paste it to the directory mentioned in the error.
And that's how I resolved this problem

No such file or directory on Mac terminal for python

hello.py is my first python program. It is saved on my desktop.
In the terminal I write in front of
user#AA-MacBook-Air ~ % python3 hello.py
The error is
can't open file 'hello.py': [Errno 2] No such file or directory
Kindly help me understand the problem and solve it.
In the terminal you are currently in the directory ~. This signifies the folder /Users/<username>. Your script is on your desktop.
Type cd Desktop to change to /Users/<username>/Desktop and then run python3 hello.py.
you first need to change destination with cd
The error message, No such file or directory pretty much gives the explanation. Check if the file hello.py is present in the correct working directory. This can done graphically or using the ls command. If it is not present, copy the file the to the directory or navigate to the location of the file hello.py in terminal using cd.

Python copy file with Fabric - Windows to Debian

I am trying to use Python Fabric to copy a file from Windows to a debian system.
SOURCE: The Windows folder is C:\Users\UserN\Downloads contains the file test_celsius.out.
DESTINATION: The Debian folder is /mnt/Reado/RoTempValC.
I can move other files from the SOURCE to the DESTINATION using WinSCP. However, I need to use Fabric to move this particular file.
I can use Fabric to change into this directory and list its current contents:
ls /mnt/Reado/RoTempValC
Here is what I have tried - in a Fabric task named move() I have this
run('mv C:\Users\UserN\Downloads\test_celsius.out /mnt/Reado/RoTempValC')
Now, here is the output:
.
.
.
.
[10.10..] Executing task 'move'
[10.10..] run: mv C:\Users\UserN\Downloads\test_celsius.out /mnt/Reado/RoTempValC
[10.10..] out: mv: rename C:/Users/UserN/Downloads/test_celsius.out to /mnt/Reado/RoTempValC/test_celsius.out: No such file or directory
[10.10..] out:
Disconnecting from 10.10.. done.
Fatal error: run() received nonzero return code 1 while executing!
Requested: mv C:/Users/UserN/Downloads/test_celsius.out /mnt/Reado/RoTempValC
Executed: /bin/bash -l -c "mv C:/Users/UserN/Downloads/test_celsius.out /mnt/Reado/RoTempValC"
Aborting.
I am not sure why it is doing this. I can correctly list the contents of the directory in Debian by using the ls command above.
Is there a way to copy this file?
EDIT:
Additional Information:
I am running the above fab move command from the Windows command
prompt.
I opened the command prompt and typed cd Python27\SGTemp
since this is where the fabfile.py is located.
Then I ran fab move.
EDIT 2:
I replaced /mnt/Reado/RoTempVal by /mnt/Reado/RoTempValC/ but got the same output as above.
Try fabric.operations.put(*args, **kwargs):
put('C:\Users\UserN\Downloads\test_celsius.out', '/mnt/Reado/RoTempValC')

Categories