I have installed python 2.7.3 on a Windows 8, 64 bit machine, sublime text and nltk 3.0.1 with the following steps:
Install Setuptools:
http://pypi.python.org/pypi/setuptools and run ez_setup.py from the directory stored in python27 (from CMD prompt)
Install NLTK: http://pypi.python.org/pypi/nltk
In nltk directory run setup.py to install nltk (from CMD prompt)
Change the environmental variables to %PYTHONPATH%;C:\Python27;C:\Python27\DLLs;C:\Python27\Lib;C:\Python27\Lib\lib2to3;C:\Python27\Scripts with PYTHONPATH with C:\Python27
Test installation: Start>Python34, then type import nltk
in sublime type
import nltk
nltk.set_proxy('xxx.xx.xx.xx:yy',('username','pwd'))
nltk.download()
However, I am met with the following error:
HTTP Error 407: Proxy Authentication Required (The ISA Server requires authorization to fulfill the request. Access to the Web Proxy Filter is denied.
Despite giving the proxy details why am I getting this error?
Please help,
Arc.
Try this format instead for setting the proxy details:
import nltk
nltk.set_proxy('https://username:password#proxy.example.com:port')
It worked for me.
This work for me on macOS 10.15
Search for 'Install Certificates.command' in finder and open it.
Now,
import nltk
nltk.download()
It will open the NLTK downloader then you can select and download the required package.
I also faced the same issue but i could able to solve with this
> nltk.set_proxy('xxx.xx.xx.xx:yy' , 'username', 'passcode')
Related
I am using a super computer to work on my project(data science) which needs big RAM.
it has big dataset that even using colab with the subscription didn’t work.
I want to run a python code nut when I run it, it sys nltk package is missing.
itried to install it but this shows up.
(my_env) [ayalmalki#klogin2 ~]$ conda install -c anaconda nltk
Solving environment: failed
CondaValueError: Malformed version string '~': invalid character(s).
after talking to the support team of the super computer they said the following:
"we only support python 3.6.8
you should use nltlk 3.6.4"
so I did downgrade python Version and tried to install nltk but it shows the same error
(my_env) [ayalmalki#klogin2 ~]$ conda install -c anaconda nltk=3.6.4
Solving environment: failed
CondaValueError: Malformed version string '~': invalid character(s).
is there a way to download nltk manually or another way to run my code other than super computer or something i need help
I want to use the Python package keyring to avoid exposing passwords in my Python scripts. According to what I've read, all you need to do is pip install keyring and then start storing and retrieving credentials. I've done this on both my Mac laptop (Big Sur) and a CentOS 7 box. On my Mac, pip list shows that version 23.1.0 of keyring is installed, and the command line utility is available. However, when I try to set a password using the command line or in python using keyring.set_password(...) I get the following error:
File "/lib/python3.7/site-packages/keyring/backends/macOS/init.py", line 38, in set_password
api.set_generic_password(self.keychain, service, username, password)
NameError: name 'api' is not defined
Line 12 of the init.py is a simple import of the api module:
from . import api
and then line 38, where the error is reported, tries to set the password:
api.set_generic_password(self.keychain, service, username, password)
Why am I getting this error? I read somewhere that you shouldn't install keyring in a venv with pip but I'm not certain why not. Any help is appreciated.
Error was introduced with version keyring==23.1.0 (Aug 15, 2021)
Once I downgraded to keyring==23.0.1 (March 25, 2021), the problem went away.
Try installing the six package by typing this in the command prompt/terminal:
pip install six
Somehow, the keyring package isn't installed properly on MacOS. See here.
Run this command:
$ /usr/local/lib/python3.7 -c "import keyring.backends._OS_X_API"
That should produce the underlying exception that's causing the module to be missing.
EDIT:
Try adding this
if sys.platform == 'darwin': # It's a solution for Mac
import keyring.backends.OS_X
keyring.set_keyring(keyring.backends.OS_X.Keyring())
else: # It's a solution for Windows
import keyring.backends.Windows
keyring.set_keyring(keyring.backends.Windows.WinVaultKeyring())
I'm using the "import ldap" in a python code. This is on a windows 10 machine.
I installed the python-ldap module
pip3 install python-ldap
Installed the dependencies based on the instructions at Python Can't install packages
Also resolved all the pip deployment issues based on Installing python-ldap in a virtualenv on Windows
I'm now getting the following error when executing the import ldap statement. am I missing something here? Any ideas to resolve it?
thon39\site-packages\ldap\__init__.py", line 34, in <module>
import _ldap
ImportError: DLL load failed while importing _ldap: The specified module could not be found.
Visit the unofficial Python binaries page:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap
Download the appropriate WHL package for your system.
For example, if you're using Python 3.8 on an x64 system, download python_ldap‑3.3.1‑cp38‑cp38‑win_amd64.whl
(hint: do NOT download the +sasl version unless you have the Cyrus SASL code running on your system...)
Start the VirtualEnv for your project, if you're using one (C:\Users\youruser\.virtualenv\YourVirtualEnv\Scripts\activate.bat) -- if you're not, skip this step.
Then run pip3 install C:\Path\To\python_ldap_x.x.x-cpXX-cpXX-winXX.whl and this should install the Python DLL (pyd) file for you.
Just installed Scrapy and Looking for Installing Portia UI for Scrapy on Python 2.7.6 (32 bit) Windows 7 (64 bit) with connectivity to IPv4 DNS Internet Service.
Getting following output error when version check is done.
C\> scrapy version
:0: UserWarning: You do not have a working installation of the service_identity
module: 'No module named service_identity'. Please install it from <https://pyp
i.python.org/pypi/service_identity> and make sure all of its dependencies are sa
tisfied. Without the service_identity module and a recent enough pyOpenSSL to s
upport it, Twisted can perform only rudimentary TLS client hostname verification
. Many valid certificate/hostname mappings may be rejected.
Scrapy 0.22.2
The project can be created but Scrapy seems non responsive to the Spiders as well.
The Scrapy installation is with all Win32 versions of in the order described on the Scrapy Site http://doc.scrapy.org/en/latest/intro/install.html and wherever required pip install or easy_install.
How shall I go about clearing the problem?
This should help:
pip install service_identity
easy_install scarpy on command prompt says scrapy is not a recognized archive type. Help!
Error Message: "error: Not a recognized archive type: Scrapy"
Unfortunately, a few dependencies of scrapy won't installed automatically from easy_install and you have to do it manually.
Install binary version of Twisted
install binary version of lxml
install Scrapy
Hope that this will solve your error message. If not, check this google group discussion with someone that had the same problem as you.