Cannot run git clone or pip install commands - windows

So i'm pretty new to the whole windows repo cloning thing. I installed python 2.7, added the path to my windows cmd and I still cannot run any git clone commands. It shows the following output :
git clone
File "", line 1
git clone
^
I've been scouring the internet for an answer but apparently it should work if I use cmd.
Any help would be appreciated!
git clone
File "", line 1
git clone
^

I have had the same issue recently with 3.7, so I made a new username and it worked. Kind of nice, a clean new Windows profile, even though I just started using it again compared to linux. A pain though.
Make sure all other versions of Python are not installed, or at least affecting the path to the file you need the pip installs to be saved. Python can be saved in a few different locations, and some rare times it has been shown in very obscure places. Check where your file saved on your PC. Probablu C:/ then could be many paths. /Users/UnserNameHere/Windows/ProgramFiles. I would use the search bar in the good old GUI while searching under the C drive (if you have multiple HDD/SDD then pic the one used for the C drive, if nothing comes up try the other drives.
Your looking for a file PythonFoundation I can't remember the entire name, however it will have a very long name Python Foundation are in the name of the file. This is where thing are store and where the path should be sending modules, at least the correct file inside that file.
Also try doing it from other Python versions installed. If you had 3.6 and got 3.7 it doesn't mean 3.6 has been deleted. Also doesn't mean you path, is not set to 3.6 while using 3.7. Same with Python 2, most people or many have both. The pip commands vary between python versions pip3 I believe is used (getting windows and linux a little mixed up right now)
If all fails do it the old fashon way, find the mod, download it, and move it to the python file I mentioned above. The homepage for python should have a tab linking to a page, or it's on the main page, letting you know where it has been known to save. Google how to see he path Pip is taking, or how to see if pip is installed and where, and what paths are set to.

Related

transcrypt issue - cannot run the sample program

Followed the instructions in transcrypt "getting started" docs, I entered the examples 'hello.html' and 'hello.py' in a separate directory.
Entering from the command line: "transcrypt -b -m hello.py" resuleds in the error message: "'transcrypt' is not recognized as an internal or external command,
operable program or batch file."
I'm using python3.6, with transcrypt installed in: C:\program files\python36\lib\site-packages\transcrypt
Any help to activate the sample hello.html would be appreciated.
Could you try python -m transcrypt -b -m hello.py
and tell me what the console output is?
Also: are you on Windows, Linux or OsX?
Answer: Windows 10
[EDIT 1]
Looks like Transcrypt was installed under a different Python distro. Would be good to know what's going on, so please keep us informed. I also have several Python installs on my Windows 10 computer and it can be confusing indeed.
[EDIT 2]
Another possibility is manual installation (although it isn't elegant...). From the docs
http://www.transcrypt.org/docs/html/installation_use.html#installation-troubleshooting-checklist
Alternatively, for manual installation under Windows or Linux, follow
the steps below:
Download the Transcrypt zip and unpack it anywhere you like
Add ../Transcrypt-/transcrypt to your system path
To enable minification, additionally the Java Runtime Environment 6 or later has to be installed
Note If you install Transcrypt manually, Trancrypt is started by typing run_transcrypt rather than transcrypt. This allows a pip
installed Transcrypt and a manually installed Transcrypt to be used
side by side selectively
BTW Thanks for the suggestion on Github. We'll look into it and try to improve the docs on this point. It seems to be quite difficult to really draw up a bullet proof installation procedure for each platform.
You might also find it easier to use python3's built in virtual env, so that you install Transcrypt and other python modules only into one project folder at a time. It's much easier to use than it at first sounds.
Here's how you might do that on Windows 10.
mkdir mynewproject
cd mynewproject
py -3 -m venv myvirtualenv # installs venv files into myvirtualenv
myvirtualenv\Scripts\activate # activates the virtual env
The py -3 command uses the python windows launcher to use the latest version of python 3. The launcher is defined in Pep 397 and the docs are here.
Once the virtual environment is activated, the prompt will change to show that. After which any 'pip install' commands will install packages into 'myvirtualenv', instead of the system wide location. If you want to deactivate it, just type 'deactivate' or close the shell window. You can also just use 'python' to refer to python3 from within the virtual env. This has saved many people from madness.
In case this helps for other newbies. A few problems I encountered when setting up transcrypt.
Path issues: I had multiple versions of python, in different folders: \python26, \python27, and \Program Files\python36.
This caused all sorts of grief, despite setting the environmental path to include the python36 distro. I fixed this issue by renaming the other versions \python26x and \python27x. This left those distros intact if ever I needed to use them, but stopped the system from finding them. Thus, it only found python36
My earlier suggestion of py -3 didn't really solve the multiple distro issue completely after all.
After doing that, I reinstalled transcrypt and it seemed OK (sort of: read on)
Second issue was trying to run the sample hello.py. I tried "transcrypt -b hello.py" and got a "'transcrypt' is not recognized.." message.
But this worked: python -m transcrypt -b -m hello.py
That worked because the system had finally found the correct version of python, due to the above fix.
Similarly, trying to run the sample hello.py as recommended in the docs caused a problem. run_transcrypt -b hello.py
The reason for this was that run_transcrypt resolved to "python $(dirname $0)/main.py $*"
But, because I had python v3.6 installed in c:\Program Files, the batch file run_transcrypt caused this output:
c:\transcrypt>python C:\Program Files\Python36\Lib\site-packages\transcrypt__main__.py -b hello.py
python: can't open file 'C:\Program': [Errno 2] No such file or directory
Consequently, I had to place Program Files in quotes and run it this way:
"C:\Program Files"\Python36\Lib\site-packages\transcrypt__main__.py -b hello.py
or else, as above: python -m transcrypt -b -m hello.py
I think, with respect, the docs should raise a warning flag here for users who have python installed in \Program Files, rather than, for example, in c:\python[x]
Third issue Changing hello.py to "play around" with the code -
I found the files in transcrypt\demos\ to be read-only. To fix this:
1: I opened the command prompt as administrator
2: I ran the attrib command to change the file attributes:
"c:\Program Files\Python36\Lib\site-packages\transcrypt\demos\hello>attrib -r -s -a hello.py"
(Without doing this as administrator you get an access-denied message)
The whole exercise caused a few hours of toing and froing, but it seems that things are better now.

jython 2.7 package installation

Jython Package installation issue, using pip
Hi, I have installed Jython2.7 configured with pydev in eclipse neon, also configured python 3.6 package
I am able to install packages for python using pip installer?
pip install "packagename"
Below are some of the packages in python/Lib/Site-packages directory
I was able to install all the packages
How do I use pip installer to install packages for jython?
I tried to install Jip package with
jython install setup.py
The binary File got installed in the Jython/Lib/Site-packages folder
However, I am not able to use it.
where and how do I get Jython package binaries like jip?
Also, Please let me know how to search jython packages?
Also, How to make pip install library packages in jython?
Any other configuration like jython home, etc that should be made?
This answer is going to be really generic but I just recently have slogged my way through the setup for jython/jip/pip and here's roughly what I had to do.
Firstly, I'm running Windows 7 64 Bit from behind a proxy (work machine.)
Had to install jython 2.7.0 instead of 2.7.1 because (I think anyway) 2.7.1 requires admin privileges which I don't have on my work PC.
Pip didn't install correctly during the Jython installation and I spent an obscene amount of time trying to get it installed and functioning as I knew it from my cpython days. NOTE: Just because you get pip installed, doesn't mean you can use any package on a python package repo. As of 2.7.0, Jython doesn't have end to end capability to interpret/compile some libraries that rely on certain python wrappers of native OS function calls. I believe 2.7.1 makes solid progress in the direction of supporting all needed native calls but don't quote me on that. For example, I tried to use wxPython to make a simple GUI to test my jython install. Trying to install it from pip kept causing really non-specific error info that took me a lot of time to figure out that the cause was jython simply couldn't compile the wxPython source so beware.
I had to set environment variables 'http_proxy' and 'https_proxy' in the form of http://proxyhosturl:port and https://proxyhosturl:port respectively to get out from behind the proxies without having to invoke pip with the proxy switch every time I called it.
To actually install pip, have a look here. These instructions are for Python and Linux/Unix but the principle is roughly the same. Just use jython -m instead of python -m and ignore the '$' at the start of each command line.
Also be sure to CD to your python_home/bin folder when invoking the ez_install exe.
If that doesn't work (didn't for me), try using get-pip.py script with these instructions https://pip.pypa.io/en/stable/installing/ (remember jython instead of python etc.). Download it, cd to the download location and follow the noted install steps. Worth noting is about half way down the install instructions where it details installing from local archives (source/binary zip or tar.gz archives of pip and setuptools as better described here: https://packaging.python.org/tutorials/installing-packages/#installing-from-local-archives).
The links to the bin archives of pip and setuptools are here:
https://pypi.python.org/pypi/setuptools
https://pypi.python.org/pypi/pip
It may also be worth making sure that your PATH environment variable has the jython/bin path in the variable value. The jython installer should do this but, again, mine did not.
If all goes well, you should be able to invoke pip with the --version switch and if it prints a line with the installed pip version info then you should be good to go
Another quirky issue I had was I could invoke a function of pip one time and any subsequent times I would get a stack trace ending with something along the lines of an object not having a certain property. I fixed that by finding my temp directory by opening a windows explorer instance and typing %TEMP% in the address bar and hitting enter, it should take you to a subdir of your AppData folder and there you may see a folder with the name of the package you were trying to install and the text "_pip" somewhere in the directory name. Delete the directory and try the pip install command again. I had to do this + invoke pip install pip -U to update my install to the latest version. Then pip began behaving correctly in my instance.
pip search numpy (or your library name) will generate a list of results with the same logic it uses to locate your desired package when you call pip install but, again, just because it returns a matching package doesn't mean it will compile when you install it (numpy doesn't work because of the missing java to C native function calls I described earlier.) The trade off is that you can import code artifacts from Java JAR files in your Jython script files and leverage their functionality with relative ease. Between the public Java APIs available and the python packages that work with the jython interpretor, you can (in my experience) come up with a way to accomplish your task. See the following info on JIP, Maven and IDEs.
IDE and jython integration (Eclipse)
- If you are stuck using Eclipse (like me) it actually has pretty decent support for python development. Install the PyDev plugin for Eclipse from Help -> Install Software. Put in this URL https://marketplace.eclipse.org/content/pydev-python-ide-eclipse, hit tab, and select the PyDev plugin and hit 'finish.'
- Setup the jython interpretor info from Windows -> Preferences -> PyDev. Provide the path to your jython.jar file.
- You should now be able to use File -> New PyDev project to create a basic python project and configure it to use your version of Jython and Java.
Brief Overview of Jip and Maven
- jip is a jython package that is invoked very similarly to pip but instead will download JAR files from the Maven Central Repository instead of python packages from pypi.com, for example. See the install instructions described here. Note the install procedure for a global jip install which differ from just pip install jip. https://pypi.python.org/pypi/jip/
- I never got jip to work exactly as I wished because there's not a ton of documentation on it outside of what I already linked. However, if you install a JAR using jip, you have to go to your project in Eclipse and actually add the JARs themselves to your PYTHONPATH in order for import statements and editing to have intellisense and so that you don't get a classnotfound exception at runtime. See following screen shot.
- There is a JIP config file that you can use similar to the pip config ini file but I have yet to find any exhaustive documentation on it's setup.
Note in the above screen shot the first entry in the External libraries entries. By default, pip places installed packages in that directory so to enable eclipse to find them, you need to also ensure that location is entered.
In Conclusion
- I have more to add to this answer and I will do so as soon as possible. In the meantime, see this example project I've loaded into github.
https://github.com/jheidlage1222/jython_java_integration_example
It shows basic config and how to interface with JARs from python code. I used the apache httpcomponents library as an example. Good luck amigo.

Full installation instruction of youtube-dl in windows

I have just downloaded the youtube-dl-2014.07.15.tar_2.gz in my windows. At first I want to tell I don't know anything about python. And I already have installed python 2.7. Can anyone give me instruction to execute these scripts?
I have already tried to run...but there is some error like these. "No mudule named youtube-dl"
I want a fresh start. Now I am using windows 8.1 and I have also tried youtube-dl.exe. And there is also problem like screenshot
If I want to get worked both script and program what will I do?Any helps will be appreciated. If you give me instruction from scratch that will be better.
To install youtube_dl in Python on Windows (command from their github):
Tested with Python 3.9 on Windows 10
pip install --upgrade youtube-dl
Now when using it, notice that the name of the Python module is with an underscore.
Because it is a Python module, use it like so:
py -m youtube_dl <video url>
Of course video url is the video you want to download
This seems to be caused by a limitation of py2exe. You may want to file a youtube-dl bug report for moving to a cxfreeze, which should not have that problem. In any case, simply moving the youtube-dl.exe file into another directory such as C:\Users\Shamim should fix the problem.
you need just to put the youtube-dl.exe file in in your home directory or any other location on your PATH.
You can see your PATH in your "Envirenment Variables"

Temp file with moniker 'svn_delta' already in use at /usr/lib/perl5/vendor_perl/5.14/Git.pm line 1024

I am trying to use git svn clone with cygwin 64 on a svn repository and I keep getting this message which errors out:
Temp file with moniker 'svn_delta' already in use at /usr/lib/perl5/vendor_perl/5.14/Git.pm line 1024.
How do I resolve this issue? I found this one that's related to macs, but I'm on windows. The two main answers there say:
"Change ~/.subversion/servers" I don't know where this is in Windows 7.
"a general upgrade to latest Git (1.8.5 should be out next week) and latest SVN 1.8 can help make things run smoothly" But in cygwin I'm stuck with git version 1.7.9.
I have a feeling the latter isn't a necessary step or else everyone using the git svn bridge in cygwin would be complaining like me.
The first answer I linked to in my question had the solution. I had to find the .subversion/servers file which existed in my cygwin path of ~/.subversion/servers. I also have a SilkSVN client and I changed that servers file there too. I found the path for that in this answer.

After updating Git Bash on Windows, still shows older version

On Git Bash's download site, it says you can clone it to update it. I downloaded it to install it, but I am starting to really get into Git and would like to clone it every time I want to update it from now on. I think I found the place where we need to clone it to, after much searching & less documentation than usual. If I am right, it is in the home directory, right under my nose the whole time!
I checked the version number with git --version beforehand, then cloned in that directory, then rechecked the version number Both times it said git version 1.8.3.msysgit.0, but on the download site it says the latest version is 1.8.4.3.
Have I not found the elusive git folder, or does the Git Bash team not let you directly clone the latest version until some time after it comes out? I know VirtualBox does that, for example.
I know this is sort of a duplicate of this question, but I tried its answer & the PATH variable didn't even have Git!
I would recommend to not try to update it, but simply download the portable version of msysgit and unzip it in a dedicated folder, that you then add to your path:
Current Portable msysgit download.
=> I unzip the latest one in (for instance) C:\prgs\git\PortableGit-1.8.4-preview20130916.
=> I add 'c:\prgs\git\PortableGit-1.8.4-preview20130916\bin' to my PATH.
Now if you want to automate that download/update process, I am building a Powershell script which does just that (for git and 30 other programs, including Mercurial, Subversion, but also Python, Ruby, Go, ...):
senv: download the zip archive of senv, unzip it in a path and call:
senv
The first time, you specify where you want all those programs to be downloaded: those are portable software only: no registry modification, no system variables modified.
If you don't want one of those program anymore, simply delete their installation folder.
That's it.
But each time you will call senv -u, it will check their respective web page and, if a new version is detected, it will download/upzip said new version in its dedicated folder, without removing the previous one.

Resources