When installing `pgmpy on Anaconda under Windows, using these instructions, I get
Installing coverage-3.5-script.py script to C:\Users\idf\Anaconda3\Scripts
Traceback (most recent call last):
File "setup.py", line 28, in <module>
"coveralls >= 0.4"
File "C:\Users\idf\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\idf\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\idf\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\install.py", line 67, in run
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\install.py", line 117, in do_egg_install
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 390, in run
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 620, in easy_install
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 671, in install_item
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 729, in process_distribution
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 639, in easy_install
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 674, in install_item
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 696, in process_distribution
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\setuptools\command\easy_install.py", line 572, in install_egg_scripts
File "C:\Users\idf\Anaconda3\lib\site-packages\setuptools-19.1.1-py3.5.egg\pkg_resources\__init__.py", line 1640, in get_metadata
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
C:\Users\idf\Downloads\pgmpy>
I might need to do:
conda create -n pgmpy-env python=3.4
source activate pgmpy-env
But then I get this error:
C:\Users\idf>source activate pgmpy-env
'source' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\idf>
So it seems these instructions assume Linux?
Don't use source on Windows. Just type:
activate pgmpy-env
source is only needed on Linux and Mac OS X.
Related
python setup.py py2exe
The following error occurred while using py2exe.
The source code for setup.py:
# setup.py
from distutils.core import setup
import py2exe
setup(console=['python.py'])
I'm trying to make python.py exe.
the mistake of this moment:
E:\ajil\Program\Query>python setup.py py2exe
running py2exe
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['python.py'])
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\distutils_buildexe.py", line 188, in run
self._run()
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\distutils_buildexe.py", line 267, in _run
builder.analyze()
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\runtime.py", line 160, in analyze
self.mf.import_hook(modname)
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 120, in import_hook
module = self._gcd_import(name)
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
return self._find_and_load(name)
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 357, in _find_and_load
self._scan_code(module.__code__, module)
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 388, in _scan_code
for what, args in self._scan_opcodes(code):
File "C:\Users\dashzeveg.b\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 417, in _scan_opcodes
yield "store", (names[oparg],)
IndexError: tuple index out of range
Use Pyinstaller that will help you for this. pyinstaller
pip install PyInstaller
pyinstaller <options> <ScriptName.py>
pyinstaller myscript.py # Normal Usage
pyinstaller --onefile myscript.py # To create single executable
I am trying to install "pwd" module using easy_install on windows and running into below error,can anyone help how to fix this error?
C:\Dropbox\scripts>easy_install pwd
Searching for pwd
Reading http://pypi.python.org/simple/pwd/
Couldn't find index page for 'pwd' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pwd
Best match: None
Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1700, in with_ei_usage
return f()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 434, in easy_install
self.local_index
File "C:\Python27\lib\site-packages\setuptools\package_index.py", line 475, in fetch_distribution
return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
pwd is a built-in module(come with python installation) for unix like only os - you can't use it on windows, try winpwd
I run the following command in terminal sudo python2.6 setup.py install and after some output I get the below error.
Traceback (most recent call last):
File "setup.py", line 16, in <module>
packages=find_packages()
File "/opt/python2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 76, in run
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 104, in do_egg_install
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 427, in easy_install
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 478, in install_item
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 519, in process_distribution
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 570, in resolve
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2149, in requires
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2141, in _dep_map
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2560, in split_sections
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1854, in yield_lines
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2163, in _get_metadata
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1181, in get_metadata_lines
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1178, in get_metadata
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1238, in _get
zipimport.ZipImportError: bad local file header in /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg
I ran the command unzip -t /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg to see if the EGG file is a valid ZIP file and it returned 'No errors detected'.
I've done some research on zipimport.ZipImportError but can't seem to figure how really to debug or fix it. I don't have much experience with Python so any help or advice would be appreciated.
Looks like all I needed to do was run sudo python2.5 setup.py install instead of sudo python2.6 setup.py install
Notice that I was oringally using python2.6 instead of python2.5.
When I try to install mitmproxy by the easy_install on windows 7, I got error with ascii.
Here is the console result from cmd.
C:\Python27\Scripts>easy_install D:_python\mitmproxy-0.9.2
Processing mitmproxy-0.9.2
Writing D:_python\mitmproxy-0.9.2\setup.cfg
Running setup.py -q bdist_egg --dist-dir D:_python\mitmproxy-0.9.2\egg-dist-tmp -qdtwhc
zip_safe flag not set; analyzing archive contents...
libmproxy.utils: module references file
libmproxy.contrib.pyparsing: module MAY be using inspect.stack
libmproxy.contrib.jsbeautifier.unpackers.init: module references path mitmproxy 0.9.2 is already the active version in easy-install.pth
Installing mitmdump script to C:\Python27\Scripts
Installing mitmproxy script to C:\Python27\Scripts
Installed c:\python27\lib\site-packages\mitmproxy-0.9.2-py2.7.egg
Processing dependencies for mitmproxy==0.9.2
Searching for pyopenssl>=0.13
Reading https://pypi.python.org/simple/pyopenssl/
Best match: pyOpenSSL 0.13.1
Downloading https://pypi.python.org/packages/2.7/p/pyOpenSSL/pyOpenSSL-0.13.1.win32-py2.7.exe#md5=02b016ed32fffcff56568e5834edcae6
Processing pyOpenSSL-0.13.1.win32-py2.7.exe
Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 9, in module
load_entry_point('setuptools==1.1.6', 'console_scripts', 'easy_install')()
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1925,
in main
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1912,
in with_ei_usage
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1929, in lambda
File "C:\Python27\lib\distutils\core.py", line 152, in
setup dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 374, in run
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 590,
in easy_install
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 641, in install_item
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 687,
in process_distribution
File "build\bdist.win32\egg\pkg_resources.py", line 568, in resolve
File "build\bdist.win32\egg\pkg_resources.py", line 806, in best_match
File "build\bdist.win32\egg\pkg_resources.py", line 818, in obtain
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 609, in easy_install
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 639, in install_item
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 792, in install_eggs
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 869, in install_exe
File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1379, in extract_wininst_cfg
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)
Someone help me please!
Warm Regards,
Rithy
If using Python 2.x, you can comment this offending line:
# config = config.decode('ascii')
in easy_install.py (near line 1510):
# Now the config is in bytes, but on Python 3, it must be
# unicode for the RawConfigParser, so decode it. Is this the
# right encoding?
config = config.decode('ascii')
cfg.readfp(StringIO(config))
ValueError: invalid version number '2.20.51.20100613'
I'm having problems installing pycrypto. Tried package manager: pip & easy_install, didn't work. Tried to manually install it via "python setup.py install", the same error like the above appears.
I've followed the instructions here and got stuck at installing pycrypto after installing "mingW" gcc, g++ and msys-base (MSYS shell environment)
Not really sure what to do now after several days of trying.
Here's the complete output of the error:
C:\Users\Denz\Desktop>pip install pycrypto
Downloading/unpacking pycrypto
Running setup.py egg_info for package pycrypto
Installing collected packages: pycrypto
Running setup.py install for pycrypto
Traceback (most recent call last):
File "", line 1, in ?
File "C:\Users\Denz\Desktop\build\pycrypto\setup.py", line 340, in ?
core.setup(**kw)
File "C:\Python24\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Python24\lib\distutils\dist.py", line 946, in run_commands
self.run_command(cmd)
File "C:\Python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "c:\python24\lib\site-packages\distribute-0.6.14-py2.4.egg\setuptools
\command\install.py", line 53, in run
return _install.run(self)
File "C:\Python24\lib\distutils\command\install.py", line 506, in run
self.run_command('build')
File "C:\Python24\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "C:\Python24\lib\distutils\command\build.py", line 112, in run
self.run_command(cmd_name)
File "C:\Python24\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python24\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "C:\Python24\lib\distutils\command\build_ext.py", line 253, in run
force=self.force)
File "C:\Python24\lib\distutils\ccompiler.py", line 1177, in new_compiler
return klass (None, dry_run, force)
File "C:\Python24\lib\distutils\cygwinccompiler.py", line 292, in init
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\Python24\lib\distutils\cygwinccompiler.py", line 83, in __init__
self.gcc_version, self.ld_version, self.dllwrap_version = \
File "C:\Python24\lib\distutils\cygwinccompiler.py", line 424, in get_versions
ld_version = StrictVersion(result.group(1))
File "C:\Python24\lib\distutils\version.py", line 40, in __init__
self.parse(vstring)
File "C:\Python24\lib\distutils\version.py", line 107, in parse
raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '2.20.51.20100613'
You can get working windows binaries on this page.