install pyquery on windows - python

I want to install pyquery on windows. But i cant run setup.py install on the command line. Do you have any hint?

I guess you don't have lxml or setuptools installed
setuptools
http://pypi.python.org/pypi/setuptools/0.6c11
lxml
http://pypi.python.org/pypi/lxml/2.2.2
Install them first and then try again, I just tried that, its working properly here.

I could not install lxml on windows with either pip or easy_install. Complained "Unable to find vcvarsall.bat"
Tried installing Cygwin and MinGW but that was taking way too long
found out from raidsan's answer about unofficial precompiled windows binaries
http://www.lfd.uci.edu/~gohlke/pythonlibs/
installed and works fine now

SIMPLE WORKING SOLUTION:
I download the tar file here pyquery-1.2.13.tar.gz (https://pypi.python.org/pypi/pyquery#downloads)
I extracted them a folder pyquery-1.2.13 then i pasted myscript.py to this folder pyquery-1.2.13 in my script i have these lines at the very top to include pyquery module and it works!
import pyquery (this file is in pyquery-1.2.13 folder)
from pyquery import *
Done.

I'm using miniconda on Windows and here is how I installed pyQuery :
Download python miniconda from http://conda.pydata.org/miniconda.html
(if you need many libraries at once, consider installing anadonda instead)
Then from the commandline prompt, run the following commands:
conda install lxml
conda install setuptools
Grab the lastest pyQuery source from https://codeload.github.com/gawel/pyquery/zip/master and unzip it to a directory.
Again from the commandline, go to this directory and run :
python setup.py install

Related

No module named 'lxml' Windows 8.1

Everyone's code online refers to sudo apt-get #whatever# but windows doesn't have that feature. I heard of something called Powershell but I opened it and have no idea what it is.
I just want to get a simple environment going and lxml so I could scrape from websites.
Go to the regular command prompt and try pip install lxml. If that doesn't work, remove and reinstall python. You'll get a list of check marks during installation, make sure you check pip and try pip install lxml again afterwards.
pip stands for pip installs packages, and it can install some useful python packages for you.
Try downloading the lxml package from here, then, on the command prompt, type in:
pip install path/to/lxml_package_file
For example, after downloading lxml‑3.5.0‑cp35‑none‑win_amd64.whl since I have Python 3.5 on a 64-bit Windows box, I type in the following commands:
cd path/to/lxml_file
pip install lxml‑3.5.0‑cp35‑none‑win_amd64.whl
Then it should install fine.
Other packages may be used instead:
import xml.etree.cElementTree as etree
import xml.etree.ElementTree as etree
import cElementTree as etree
import elementtree.ElementTree as etree
The lxml.etree Tutorial

How to install lxml in Python 3.4 on Windows machine

I've been spending hours on this. I'm new to Python and can't see what the solution may be.
I have Python 3.4 and want to work with .docx, which requires lxml.
The workflow I've done so far is: I go to the Python lxml package installer page, but it's quite confusing to know which version I need. I tried with several of them that contained the 34 numbers, both .exe and .tar. I also tried pip install lxml3.4.4 and pip install lxml 3.4.4. None of them worked either.
This is what the command prompt says when I did pip install lxml (it automatically grabs the lxml 3.4.4 I've downloaded and then prints what you can see in the screenshot):
What am I doing wrong and what can I do to repair it? And/or what exact version of lxml do I need to install from where? I am really discouraged that this is so difficult. Thanks
As said at the lxml homepage, it happened to you:
If you fail to build lxml on your MS Windows system from the signed and tested sources that we release, consider using the binary builds from PyPI or the unofficial Windows binaries that Christoph Gohlke generously provides.
So you have to download the right wheel file from Unofficial Windows Binaries for Python Extension Packages.
Step 1: Download appropriate version
Depending on your machine you have to download the wheel file lxml‑3.4.4‑cp34‑none‑win32.whl or lxml‑3.4.4‑cp34‑none‑win_amd64.whl, because you want the version for Python3.4 (that's the 34 in cp34).
Step 2: Open cmd and navigate to the download folder
I have chosen to open the cmd in administrator mode. But this is probably not necessary for you.
Step 3: Install wheel file with pip
Now you have to install the unofficial wheel file with pip. Maybe you can do pip install pip --upgrade before you install the wheel file. But this is probably also not necessary for you. To do the installation, just type pip install <downloaded_file>.
Or as cgohlke mentioned in his comment to your question: If you can't do pip install in cmd directly, this is what you can try: C:\Python34\python.exe -m pip install <downloaded_file>. You have to edit the path if Python3.4 is installed elsewhere, of course.
Don't panic. If you try to install the wrong downloaded file (e. g. win32 instead of amd64), it shouldn't break anything. An error message should occur: <package name> is not a supported wheel on this platform.

Error installing from GitHub using pip on Windows

I am on a Windows machine and I want to install a Python module from GitHub using pip directly from IPython.
The simplest command that seems it should work is:
!pip install https://github.com/japerk/nltk-trainer.git
I have also tried:
!pip install https://github.com/japerk/nltk-trainer.git#egg=nltk-trainer
I've used variants including -vvv, etc.
However, I'm getting the following error. Why?
Cannot determine archive format of C:\Users\timo\AppData\Local\Temp\pip-build-183bwemw\nltk-trainer
go to the https://github.com/japerk/nltk-trainer and download the project zip file. extract the zip file and put it somewhere in your computer.
open command prompt in windows and go inside the folder that you extracted earlier(you must be in the folder that has setup.py file in it).
enter the following command: python setup.py install
python tries to install nltk-trainer . during installation some other dependency might be installed too. you need numpy and scipy to be installed. if any problem happened during installation of numpy or scipy try installing them manually first by using pip install numpy and pip install scipy
if you can't install numpy and scipy using pip command use the following link:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
this site has compiled version of these libraries ( and other libraries if you need to install them too) you can download .whl file that is based on your python version and os architecture and install them using pip install filename.whl command ( you need to be in the folder that your whl file is) for example for python3.4 and 64bit operating system you may download scipy‑0.16.0‑cp34‑none‑win_amd64.whl file.

How to install LXML Python 3.3 Windows 8 64 Bit

I think I'm too stupid for installing LXML Lib on my System.
Please can anyone help me with instructions for stupid people?
I found a lot of instruction, but they did not help me much.
I looked at LXML-Homepage
For installation I need pip 1.4.1? I downloaded it... But, how can I install it?
Unzip pip-1.4.1.tar.gz
Then I opened the setup.py with my Python Shell.
Run the modul:
Traceback (most recent call last):
File "C:\................\dist\pip-1.4.1\setup.py", line 5, in <module>
from setuptools import setup, find_packages
ImportError: No module named 'setuptools'
Ok.. now I thought I need setuptools...
Downloaded setuptools-1.4.1-py2.py3-none-any.whl
Unziped it.. run the easy_install.py with my python shell
SystemExit: error: No urls, filenames, or requirements specified
Same error if started in windows command console.
What should I do?
If you on Windows, why not to use binary packages with normal installers?
You can find them on this page: http://www.lfd.uci.edu/~gohlke/pythonlibs/
You can also use anaconda. Once you have it installed (http://continuum.io/downloads) you can just run conda install lxml to install lxml. It's also very useful for packages like numpy and scipy, which can sometimes be a pain to install on Windows.
These instructions are for Windows7 or Windows8 with Python3.3 specifically as the original poster requested. However, they should work for various versions as the releases of python and other respective prerequisites change/evolve:
Install Python3.3:
Download the last release of Python3.3 (currently 3.3.5) from the downloads page HERE
Direct link for Win32 MSI installer -> HERE
Direct link for Win64 MSI installer -> HERE
Simply run the MSI to install python. It will register itself in the registry, and appear in Add/REmove Programs.
NOTE: my instructions that follow assume that you choose to install python to the default path of C:\python33\ when asked during the Python Installation Wizard
Add the C:\python33\ and C:\python33\scripts folders to the system path by adding those directories to the PATH environment variable from the Control Panel > System > Advanced System Settings link (Advanced Tab) > Environmental Variables (Button).
Install OpenSSL:
Download Win32 OpenSSL page from HERE for your version of Windows and PC architecture
Download Visual C++ 2008 redistributables for your version of Windows and PC architecture
Download OpenSSL for your version of Windows and architecture (the regular version, not the light one)
Add the c:\openssl-win32\bin (or similar) directory to your PATH, the same way you added C:\python33 and C:\python33\scripts above.
Install Setuptools (get-pip.py should install Setuptools for you), but, just in case...
Download ez_setup.py HERE and save it in C:\python33\scripts
Run C:\python33\scripts> python ez_setup.py
Install PIP
Download get-pip.py from HERE and save it in C:\python33\scripts
Run C:\python33\scripts> python get-pip.py
Install LXML
Download LXML 3.3.3 from HERE for your version of Windows and PC architecture
Run the EXE file
Download lxml based on your version dependencies from here,
http://www.lfd.uci.edu/~gohlke/pythonlibs/djcobkfp/lxml-3.4.4-cp27-none-win32.whl # replace lxml version based on your dependencies..
http://www.lfd.uci.edu/~gohlke/pythonlibs/
and open your command prompt open lcoation Downloads or where file Downloaded in cmd..
that install using,
pip install lxml-3.4.4-cp34-none-win_amd64.whl # this is eg name may vary based on your python or lxml version.

Can't install Beautifulsoup ("bs4 does not exist")

I'm struggling to get BeautifulSoup installed on Windows. So far, I have:
downloaded BeautifulSoup to "My Downloads".
unzipped/ extracted it in the downloads folder.
At the command prompt, I ran:
C:<path to python33> "C:path to beautiful soup\setup.py" install
The process generated the messages:
running install
running build
running build_py
**error: package directory 'bs4' does not exist.**
Yet, in the path to BeautifulSoup in quotes above, there is indeed the folder bs4. What am I missing?
You need to be in the directory containing setup.py to run it. Make sure your working directory is correct.
I had a similar problem. In my case, I was able to get pip to work, but first I had to look up the right name for the package:
wrong: pip install bs4
fail
wrong: pip install beautifulsoup
fail
right: pip install beautifulsoup4
Successfully installed beautifulsoup4
I had same problem when tryingo to export my wordpress blog to jekyll with this tutorial.
My first step was to install pip with success & next try to install BeautifulSoup with it:
pip install bs4 # failed
pip install BeautifulSoup # that was succes
But... 2nd line install BeatifulSoup3, not most recent version 4...
So I've uninstalled bs3:
pip uninstall BeautifoulSoup # with success
Downloaded most recent bs4 from this site & installed it manually within command/mingw:
cd %bs4-download-dir%
python setup.py install
And now everything is OK :)
For clean install without pip nor easy_install :
Your paths
(change it by your paths)
Your python path : c:\Python27\python.exe
Your beautyfulsoup path : c:\BeautifulSoup
Instruction to follow for clean installation :
cd c:\BeautifulSoup
"c:\Python27\python.exe" setup.py install
Have fun and share !
“Any fool can know. The point is to understand.”
Make sure the batch file you used to run "python" "\beautifulsoup4-4.3.1\setup.py" install is in the same directory as "\beautifulsoup4-4.3.1\setup.py"

Categories

Resources