Installing Kobo module on the system along with python 2.7.3 - python

I have python 2.7.3 installed on my system an I am trying to install Kobo module. The path where the module is located is:
C:\Users\nelson.menezes\Desktop\new softwares\kobo-0.3.6
.I opened the command promt and set the above mentioned path. Then as specified I run the following command to install Kobo.
python setup.py install
But it gives me the following error
File "c:\python27\lib\distutils\util.py", line 204, in convert_path
raise ValueError, "path '%s' cannot be absolute" % pathname
ValueError: path '/usr/bin' cannot be absolute
I know that it an error generated due to Path problems. But I cannot figure out how to resolve it. It would be great if anyone could help in any possible way.
The full traceback is as follows:
running install
running build
running build_py
running install_lib
running install_data
Traceback (most recent call last):
File "setup.py", line 91, in <module>
scripts = script_files,
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\distutils\command\install.py", line 575, in run
self.run_command(cmd_name)
File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\distutils\command\install_data.py", line 58, in run
dir = convert_path(f[0])
File "c:\python27\lib\distutils\util.py", line 204, in convert_path
raise ValueError, "path '%s' cannot be absolute" % pathname
ValueError: path '/usr/bin' cannot be absolute

Related

"AttributeError: 'float' object has no attribute 'replace'" error when installing a python package

I am trying to install a python package DMRG101 on Linux Zorin. I get this package from GitHub https://github.com/iglpdc/dmrg101. I have python 2.7.12 and python 3.5.2 installed. I tried to install this package using
python setup.py install
but it is giving me the following error
running install
running build
running build_py
running install_lib
running install_egg_info
Traceback (most recent call last):
File "setup.py", line 30, in <module>
requires = [],
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/install.py", line 613, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/usr/lib/python2.7/distutils/command/install_egg_info.py", line 46, in finalize_options
to_filename(safe_version(self.distribution.get_version()))
File "/usr/lib/python2.7/distutils/command/install_egg_info.py", line 88, in safe_version
version = version.replace(' ','.')
AttributeError: 'float' object has no attribute 'replace'
how can I eliminate this error?
I just go to install_egg_info.py and modify this line as:
version = str(version).replace(' ','.')
Then, rerun the install command again and it works.

path '%s' cannot be absolute" % pathname

I am trying to install Gelatin for python 3 with pip and I am getting this traceback:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\abejd\AppData\Local\Temp\pip-build-u3685bna\SimpleParse\setup.py", line 108, in <module>
**extraArguments
File "c:\python36-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python36-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python27\Lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python36-32\lib\distutils\command\install.py", line 557, in run
self.run_command(cmd_name)
File "c:\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python27\Lib\site-packages\setuptools\command\install_egg_info.py", line 34, in run
self.run_command('egg_info')
File "c:\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python27\Lib\site-packages\setuptools\command\egg_info.py", line 279, in run
self.find_sources()
File "C:\Python27\Lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
mm.run()
File "C:\Python27\Lib\site-packages\setuptools\command\egg_info.py", line 533, in run
self.add_defaults()
File "C:\Python27\Lib\site-packages\setuptools\command\egg_info.py", line 569, in add_defaults
self.read_manifest()
File "C:\Python27\Lib\site-packages\setuptools\command\sdist.py", line 201, in read_manifest
self.filelist.append(line)
File "C:\Python27\Lib\site-packages\setuptools\command\egg_info.py", line 475, in append
path = convert_path(item)
File "c:\python36-32\lib\distutils\util.py", line 125, in convert_path
raise ValueError("path '%s' cannot be absolute" % pathname)
ValueError: path '/home/mcfletch/OpenGL-dev/simpleparse/simpleparse/stt/TextTools/mxTextTools/mxTextTools.c' cannot be absolute
I have tried 2 solutions but to no avail have I solved the problem. If there is any other information that I can provide to try and fix this please let me know.
Thanks ahead of time!
I had similar problem with pg-chameleon, caused by this rows in setup.py:
conf_dir = "/%s/pg_chameleon/configuration" % python_lib
conn_dir = "/%s/pg_chameleon/connection" % python_lib
sql_dir = "/%s/pg_chameleon/sql" % python_lib
sql_up_dir = "/%s/pg_chameleon/%s" % (python_lib, sql_up_path)
Error looked like:
ValueError: path '/f:\work\pycharmprojects\virtualenvironments\mysql2psql\Lib\site-packages/pg_chameleon/configuration' cannot be absolute
I solved this issue by downloading pg_chameleon-2.0.10.tar.gz and editing setup.py it (I removed '/' before '%s')
Then i did:
pip install "path-to-my-package"
and got
Successfully installed pg-chameleon-2.0.10
The problems seem to be related to the C:\Users\maparama\Documents\SimpleParse-2.2.0\SimpleParse-2.2.0\SimpleParse.egg-info\SOURCES.txt
Steps
Download the package from
https://pypi.org/project/SimpleParse/#files
Remove the SimpleParse.egg-info/ directory
perform python setup.py install.
C:\Users\maparama\Documents\SimpleParse-2.2.0\SimpleParse-2.2.0>pip list
Package Version
-------------- -------
gelatin 2.2.10 <---
lark-parser 0.6.4
lxml 4.2.5
pip 10.0.1
PyYAML 3.13
robotframework 3.0.4
setuptools 40.4.3
simpleparse 2.2.0

cx_freeze error "cx_Freeze.freezer.ConfigError: no base named Console"

I'm trying to convert a python 3.4 program of mine into an exe for distribution. I tried using cx_Freeze to do this. However, when I run python setup.py build with this setup.py:
from cx_Freeze import setup, Executable
setup( name = "Converter" ,
version = "0.1" ,
description = "" ,
executables = [Executable("filename.py")] , )
I get this error code:
C:\Python34>python setup.py build
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 6, in <module>
executables = [Executable("helloworld.py")] , )
File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
distutils.core.setup(**attrs)
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 231, in run
metadata = metadata)
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 136, in __init__
self._VerifyConfiguration()
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 504, in _VerifyConfiguration
self._GetBaseFileName()
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 239, in _GetBaseFileName
raise ConfigError("no base named %s", name)
cx_Freeze.freezer.ConfigError: no base named Console
This same error code occurs when I try to setup for a hello world file. So it has nothing to do with my script.
Any help? This is the first time I've used cx_Freeze.
It appears that this line is failing argsSource.base = self._GetFileName("bases", name, ext) which means that it can't find that file, which makes sense. Check this folder C:\Python27\Lib\site-packages\cx_Freeze\bases for Console.exe. If you don't have that then try reinstalling cx_freeze. That's my directory for python. I would assume yours is in the same place but if not just search for it
Just type in cmd "pip uninstall cx_Freeze" for uninstall cx_Freeze and again reinstall it by type "pip install cx_Freeze".

How can a module with setup.py installed using Cython?

First I've no experience with python. I just want to install a module in blender which comes with a setup.py. It seems that I need Cython to install that. I added Cython to PYTHONPATH and the bin folder to the PATH. This error is shown:
python setup.py install
running install
running build
running build_ext
Traceback (most recent call last):
File "setup.py", line 17, in <module>
cmdclass = {'build_ext': build_ext})
File "C:\Python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python33\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\distutils\command\install.py", line 569, in run
self.run_command('build')
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 163, in run
_build_ext.build_ext.run(self)
File "C:\Python33\lib\distutils\command\build_ext.py", line 354, in run
self.build_extensions()
File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 170, in build_extensions
ext.sources = self.cython_sources(ext.sources, ext)
File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 181, in cython_sources
from Cython.Compiler.Main \
File "C:\Cython-0.19.1\Cython\Compiler\Main.py", line 302
except UnicodeDecodeError#, e:
^
SyntaxError: invalid syntax
Versions are: Python 3.3 / Windows7 64 / Cython-0.19.1
Any ideas, what should I try?
It looks like your Cython installation was damaged somehow. You might want to consider getting a fresh installation, perhaps from the Cython Windows installer for Python 3.3.

No initscrip name console - CX_freeze

I have been trying to get cx_freeze working on ubuntu, but when i try to run the "python setup.py build" i get the following error:
cx_Freeze.freezer.ConfigError: no initscript named Console
I have searched google and i see a lot of people have ahd this issue, but i can't seem to find a solution.
my setup.py code is as follows:
from cx_Freeze import setup, Executable
setup( name = "hello world" ,
version = "0.1" ,
description = "Hello" ,
executables = [Executable("hello.py")] ,
)
I have placed the setup.py file and hello.py in the same folder.
Any idea as to what could solve this problem?
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 7, in <module>
executables = [Executable("hello.py")] ,
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze-4.3.1-py2.7-linux-i686.egg
cx_Freeze/dist.py", line 365, in setup
distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze-4.3.1-py2.7-linux-i686.egg
/cx_Freeze/dist.py", line 234, in run
metadata = metadata)
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze-4.3.1-py2.7-linux-i686.egg
/cx_Freeze/freezer.py", line 104, in __init__
self._VerifyConfiguration()
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze-4.3.1-py2.7-linux-i686.egg
/cx_Freeze/freezer.py", line 466, in _VerifyConfiguration
self._GetInitScriptFileName()
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze-4.3.1-py2.7-linux-i686.egg
/cx_Freeze/freezer.py", line 311, in _GetInitScriptFileName
raise ConfigError("no initscript named %s", name)
cx_Freeze.freezer.ConfigError: no initscript named Console
For my installation I took same problem. Looks like symbolic link for initscripts not created, so I make it manually and everything works (change cx_Freeze version to your own):
cd /usr/local/lib/python2.7/dist-packages/
cd cx_Freeze-4.3.1-py2.7-linux-i686.egg
sudo ln -s -t cx_Freeze/ ../../cx_Freeze/initscripts/
PS: Ubuntu 12.10/quantal, Python 2.7.3

Categories