Reputation: 17
I'm following the directions Spacy gives to install for Windows, Python 3, and from source (pip and conda have both given me errors that I've still been unable to resolve, directly from source seems to get the closest to actually installing). However, when I get to step 3 and enter export PYTHONPATH = pwd
in the command line (with the quotes around pwd like it wants, it just messes up the formatting here), I get this error message:
export is not recognized as an internal or external command, operable program, or batch file.
I've read that how to fix this error in the past is to add a path through the environmental variables option, however I'm not sure what that would look like here. I'm not sure what pwd is on my computer or how to get a path to it.
I have the newest version of python 3 (just downloaded today), as well as microsoft visual studio, which is apparently needed for using Spacy. Any help would be greatly appreciated. Thanks!
Upvotes: 1
Views: 1192
Reputation: 366053
Looking at the linked install directions, if you select "from source", it seems to ignore the OS choice and give you bash-specific instructions no matter what.
While you can get and run bash for Windows, your shell is probably not bash, but cmd (aka "DOS prompt"), which is completely different.
(As a side note, those extra spaces you added around the =
would make your attempt fail even if you were using bash. It's important to be exact, especially when working with languages that you don't know.)
Fortunately, what you're trying to do is very simple—just set a single environment variable for the rest of this shell session.
The rough cmd equivalent to bash's export
is SET
. Unfortunately, there is no rough equivalent of the backtick syntax to call pwd
and stash the resulting output. The easiest thing to do here is to do it manually, by copying in the current working directory. For example:
C:\Spam\Eggs> git clone https://github.com/explosion/spaCy
C:\Spam\Eggs> cd spaCy
C:\Spam\Eggs\spaCy> SET PYTHONPATH="C:\Spam\Eggs\spaCy"
C:\Spam\Eggs\spaCy> pip install -r requirements.txt
C:\Spam\Eggs\spaCy> python setup.py build_ext --inplace
You might also want to consider using py
instead of python
, and running pip
as a module rather than as a script:
C:\Spam\Eggs> git clone https://github.com/explosion/spaCy
C:\Spam\Eggs> cd spaCy
C:\Spam\Eggs\spaCy> SET PYTHONPATH="C:\Spam\Eggs\spaCy"
C:\Spam\Eggs\spaCy> py -m pip install -r requirements.txt
C:\Spam\Eggs\spaCy> py setup.py build_ext --inplace
But if you only have a single Python installation, and your python
and pip
are both working properly, this shouldn't make any difference.
Upvotes: 1