install senticnet in python 3.5 - windows-8

I'm trying to install senticnet on python 3.5 in windows 8 using pip like this :
pip install senticnet
In the end of the installation I get this error :
Using cached senticnet-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\2017\AppData\Local\Temp\pip-build-bzamjfpz\senticnet\setup.py", line 20, in <module>
license=open('LICENSE').read(),
File "f:\python35\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 186 : character maps to <undefined>
----------------------------------------
I tried the suggested solution in Installing SenticNet package on Anaconda gives UnicodeDecodeError but I didn't find the setup.pip file.
Can anyone help me ?

The problem is the encoding.
Open "setup.py", find "license=open('LICENSE').read()", add "encoding='latin-1'" in the open method. i.e.:
license=open('LICENSE', encoding='latin-1').read()
It works for me.

Related

Cannot start tensorboard from console due to numpy issue

I'd like to make use of TensorBoard.I already saved training and validation data in the same directory as the rest of the project data using the tensorflow.keras.callbacks library.
I already pip reinstalled numpy, didn't work out. Then I deleted tb-nightly and tensorboard as I had them both for some reason and just pip reinstalled tb-nightly.
(Tensorflow) C:\Users\alias>python -c "print(__import__('numpy').__version__)"
1.16.2
(Tensorflow) C:\Users\alias>python -c "print(__import__('tensorflow').__version__)"
2.0.0-alpha0
(Tensorflow) C:\Users\alias>python -c "print(__import__('tensorboard.version').version.VERSION)"
1.14.0a20190301
When calling it via Anaconda prompt on a Win10-OS , the following happens:
(Tensorflow) C:\Users\alias>tensorboard --logdir=logs\
TensorBoard 1.14.0a20190301 at http://LAPTOP-4E1BJCAV:6006 (Press CTRL+C to quit)
Traceback (most recent call last):
File "c:\users\alias\anaconda3\envs\tensorflow\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\alias\anaconda3\envs\tensorflow\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\alias\Anaconda3\envs\Tensorflow\Scripts\tensorboard.exe\__main__.py", line 9, in <module>
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\main.py", line 58, in run_main
app.run(tensorboard.main, flags_parser=tensorboard.configure)
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\absl\app.py", line 300, in run
_run_main(main, args)
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\program.py", line 228, in main
self._register_info(server)
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\program.py", line 274, in _register_info
manager.write_info_file(info)
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 269, in write_info_file
payload = "%s\n" % _info_to_string(tensorboard_info)
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 129, in _info_to_string
for k in _TENSORBOARD_INFO_FIELDS
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 129, in <dictcomp>
for k in _TENSORBOARD_INFO_FIELDS
File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 51, in <lambda>
(dt - datetime.datetime.fromtimestamp(0)).total_seconds()),
OSError: [Errno 22] Invalid argument
Would be glad about some help.
Thanks in advance!
Did you do a fresh install and or update recently?
Not sure if this applies to your case or not? Yesterday I installed the latest conda, for python 2.7, from scratch and updated to the latest packages after installation. Running python from pycharm or windows powershell and importing numpy would throw a multiarray import error. The fix for me was to downgrade numpy from ?1.16.12? to ?1.5.14?. Sorry, but I am away from my PC's were I encountered the error but I think those versions are correct.
I experienced the same error in my local Jupyter notebook. Upgrading Numpy package worked for me.
Try upgrading Numpy as below
pip install numpy==1.16
If the above doesn't work, upgrade tensorflow with below command and try again
pip install tensorflow --upgrade
The issue was solved # Github https://github.com/tensorflow/tensorboard/issues/2092
Thanks for the support

mysql-python won't install on MacOS

So I have tried multiple ways to install mysql-python and MYSQLdb. I have tried downloading through this link: https://sourceforge.net/projects/mysql-python/ and then when I run python setup.py install I get the following errors:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Traceback (most recent call last):
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 7, in <module>
use_setuptools()
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 124, in _do_download
to_dir, download_delay)
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 194, in download_setuptools
src = urlopen(url)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: SSL is required
I could not find a resolution that worked so I tried pip install mysql-python and then I get the following
Traceback (most recent call last):
File "setup.py", line 6, in <module>
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
NameError: name 'url' is not defined
Jacksons-MacBook-Pro:MySQL-python-1.2.4b4 Jackson$ pip install mysql-python
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-kdgbz3qe/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-build-kdgbz3qe/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-kdgbz3qe/mysql-python/
When I look this problem up I tried running:
pip install --upgrade setuptools
pip install ez_setup
easy_install -U setuptools
With no problems, but then when I tried rerunning the command pip install mysql-python I get the same error as before. I tried downloading the mysqlclient and the mysql/python connector and nothing is working. I just want a fix for trying to install mysql-python, mysqlclient, MYSQLdb, mysql/python connector or anything that will actually work. I already have mysql installed and running as well as Sequel Pro.
I could solve the issue by running the combination of #Devstr an #jsteele. I realized that the python module to connect from python to mysql is not mysql but ```mysql-connector``.
Follow these steps:
brew cask install mysql-connector-python
pip search mysql-connector | grep --color mysql-connector-python
pip install mysql-connector-python-rf
then in python:
import mysql.connector
...
found some useful info: What's the difference between MySQLdb, mysqlclient and MySQL connector/Python?
Maybe use brew?
brew cask install mysql-connector-python
see https://apple.stackexchange.com/questions/130324/how-to-install-mysql-utilities-using-brew-or-brew-cask#136180

I get "SyntaxError" for rst2pdf command after installing RST2PDF in Windows 7

After I install RST2PDF in Windows 7, and run the command rst2pdf or rst2pdf -h, it says
SyntxError: Invalid syntax
I installed rst2pdf V.93 using PIP and have set the path to scripts in python directory.
Here is the error:
c:>rst2pdf Traceback (most recent call last): File
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\Scripts\rst2pd
f-script.py", line 9, in
load_entry_point('rst2pdf===0.93.dev-r0', 'console_scripts', 'rst2pdf')() File
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name) File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 2682, in load_entry_point
return ep.load() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 2355, in load
return self.resolve() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 2361, in resolve
module = import(self.module_name, fromlist=['name'], level=0) File
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\rst2pdf\createpdf.py", line 695
except ValueError, v:
^ SyntaxError: invalid syntax
The syntax for exception handling changed with python 3: instead of except ValueError, v one must use except ValueError as v.
Apparently, rst2pdf has no support for python3. To use it, you must have python2.7 installed. Some attempts have been made to port rst2pdf, but the efforts seem to have stalled.
Alternatively, you may try to use pandoc, as suggested here

Cannot install or use scrapy on OS X -- blocked by proxy (I think)

So I am really having a tough time with something that should be very easy. AT work we have a lot of annoying proxies etc. and I'm pretty sure that's involved here. Anyhow, when I try to install scrapy, I get "Connection reset by peer" in the middle of downloading libxml, always 37% of the way in:
root#rcmac (~ ): pip install scrapy
Requirement already satisfied (use --upgrade to upgrade): scrapy in /Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): Twisted>=10.0.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): w3lib>=1.8.0 in /Library/Python/2.7/site-packages (from scrapy)
Collecting queuelib (from scrapy)
Using cached queuelib-1.2.2-py2.py3-none-any.whl
Collecting lxml (from scrapy)
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading lxml-3.4.2.tar.gz (3.5MB)
37% |############ | 1.3MB 186kB/s eta 0:00:12 Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 345, in prepare_files
functools.partial(self._prepare_file, finder))
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 290, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 487, in _prepare_file
download_dir, do_download, session=self.session,
File "/Library/Python/2.7/site-packages/pip/download.py", line 827, in unpack_url
session,
File "/Library/Python/2.7/site-packages/pip/download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "/Library/Python/2.7/site-packages/pip/download.py", line 888, in _download_http_url
_download_url(resp, link, content_file)
File "/Library/Python/2.7/site-packages/pip/download.py", line 621, in _download_url
for chunk in progress_indicator(resp_read(4096), 4096):
File "/Library/Python/2.7/site-packages/pip/utils/ui.py", line 133, in iter
for x in it:
File "/Library/Python/2.7/site-packages/pip/download.py", line 586, in resp_read
decode_content=False):
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 273, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 203, in read
data = self._fp.read(amt)
File "/Library/Python/2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 49, in read
data = self.__fp.read(amt)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 567, in read
s = self.fp.read(amt)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 241, in recv
return self.read(buflen)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 160, in read
return self._sslobj.read(len)
error: [Errno 54] Connection reset by peer
I can get my hands on the libxml tarball, but I don't know how to get pip past this roadblock. I have somehow managed to get scrapy installed but it blows up when I try to import it:
root#rcmac (~ ): python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrapy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/__init__.py", line 56, in <module>
from scrapy.spider import Spider
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/spider.py", line 7, in <module>
from scrapy.http import Request
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/http/__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/http/request/form.py", line 9, in <module>
import lxml.html
ImportError: No module named lxml.html
So let's see: I guess my question is, "Help?" :-) thanks.
OK, solved again. Sorry. It looks like a proxy server here at work was blocking my lxml install from pip. I reran the pip install command for scrapy and lxml got properly installed at that point. After that, the error went away.

Blender not working with Python

I'm trying to run an external script with blender 2.49b and 2.57
I tried with installing Python versions, 2.4, 2.6 and 2.7.
I'm getting this error in the console window.
Anyone have a clue of what I'm missing?
Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Blender
2.49b.blender\scripts\blended_cities_24hook.py ", line 77, in
from random import randint,random,uniform File "C:\Python24\LIB\random.py", line 41, in
from warnings import warn as _warn File "C:\Python24\LIB\warnings.py", line 258, in
simplefilter("ignore", category=OverflowWarning, append=1) NameError: name 'OverflowWarning' is not defined
Computer Info:
Operating Sys: Win7 x64.
CPU: Intel.
Fixed it! In my sys vars, I had the Python path set to the 2.4 version, which doesn't work with these versions of blender.