Can not install hcluster from pypi under python 2.6 on xp - python

I am using the setup.py file supplied with hcluster with the following lines added:
sys.path.append("c:\\Program Files\\Python26\\Lib\\site-packages\\hcluster-0.2.0")
sys.path.append("c:\\Program Files\\Python26\\Lib\\site-packages\\hcluster-0.2.0\\hcluster")
Then used setup.py as follows:
"c:\program files\python26\python.exe" "c:\Program Files\Python26\Lib\site-packages\hcluster-0.2.0\setup.py" install
I get the following error messages:
running install
running build
running build_py
error: package directory 'hcluster' does not exist
Don't know if it trying to read or write hcluster.
Any help appreciated

You don't need to add packages in site-packages in sys.path.
Did you copy the hcluster in site-package manually? It is not the correct way to do it.
2.1 You should have the hcluster outside the site-packages say in your home directory and then run "python setup.py install"
2.2 This will put the package after build into site-package directory. This is where all external package reside by default after they are installed.
Remove the folders related to hcluster from site-packages and install with instruction 2.
Read the following to understand your error: http://docs.python.org/install/index.html

Related

python3 setup.py install is failing (RHEL 8)

Issue:
#python3 setup.py install
is failing
Environment: RHEL 8 UBI container
I have a setup.py that looks like this: (any pointers or updates on this setup.py would be appreciated)
import setuptools
print('python/setup.py')
setuptools.setup(
name="process_data",
version="1.0",
description="desc",
author="FirstName LastName",
author_email="dude#abides.abide",
url="https://some.com",
packages=setuptools.find_packages(),
)
I have a directory structure like so (<some>.py in every directory, along with __init__.py):
python/
setup.py
<dir>/__init__.py
<dir>/__init__.py
<dir4>/__init__.py
<dir4>/<sub-dir1>/__init__.py
<dir4>/<sub-dir1>/<sub-dir>__init__.py
I want code in each of these directories to be part of a module package so I can import, nested however deep.
I'm doing this:
#cd python
#python3 setup.py install
I get this error:
python/setup.py
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
/usr/local/lib/python3.6/site-packages/test-easy-install-1625.write-test
[Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/test-easy-install-1625.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python3.6/site-packages/
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
Questions:
Where is this coming from: test-easy-install-1625.write-test ? (so confused as to what this is)
On my system, indeed this directory does not exist (why is python3 setup.py install looking there? what told it to look there?):
/usr/local/lib/python3.6
There is nothing in my setup.py to indicate to look there.
I looked all over, and it looks like my /site-packages/ directory is here (where other modules are installed, when I ran pip)
`/usr/local/lib64/python3.6/site-packages/`
How do I fix this?
Thank you, I so badly need to get this working right away. I have been working on Windows, and >python setup.py install simply works there.
Are there any env variables I should have setup?
I simply installed python with: dnf -y install python36 that's it. (the latest version available in any RHEL 8 package repo for installation).
I ran into this same error and I was able to fix it by creating a symbolic link. I accept someone else maybe able to offer a more elegant solution and I welcome it.
sudo mkdir /usr/local/lib/python3.6
sudo ln -s /usr/lib/python3.6/site-packages /usr/local/lib/python3.6/
I assume you had enter python command mode, if you don't, the following commands are needed, notice to set variable Path and PythonPath of yours:
setlocal
set env_name=python3.6
set Path=C:\Users\s41167\Miniconda3\envs\%env_name%;C:\Users\s41167\Miniconda3\envs\%env_name%\Scripts;%Path%
set PythonPath=C:\Users\s41167\Miniconda3\envs\%env_name%\Lib\site-packages
cd C:\Users\s41167\Documents\%env_name%
cmd.exe /K activate %env_name%
if you enter python command mode, you can use pip to insall the package:
pip install <package location> --target <install location> --upgrade
below is my install command and result:
(python3.6) C:\Users\s41167\Documents\python3.6>pip install ./python_package --t
arget ./target --upgrade
Processing c:\users\s41167\documents\python3.6\python_package
Building wheels for collected packages: process-data
Building wheel for process-data (setup.py) ... done
Created wheel for process-data: filename=process_data-1.0-cp36-none-any.whl si
ze=1721 sha256=ef5eaf061000f30d472e5dde268694733e40a3f8a4a29fa78faec69f125443c9
Stored in directory: C:\Users\s41167\AppData\Local\Temp\pip-ephem-wheel-cache-
v6lt_ndp\wheels\61\01\f5\07e0760baa10d63e1c43b37eadbb55b79828f4fe337209026a
Successfully built process-data
Installing collected packages: process-data
Successfully installed process-data-1.0
(python3.6) C:\Users\s41167\Documents\python3.6>
and the file arrangement:
.\python_package
__init__.py
setup.py
\directory
__init__.py
\directory4
__init__.py
\sub_dirctory1
__init__.py
in Linux use
sudo python3 setup.py install
in windows use
python setup.py install
or
python3 setup.py install

Distribute pip package no source code

I have an "homemade" python package which i can successfully install via pip package manager.
I'd like ti distribute it without giving the source code (*.py files)... i tried to compile them with
python -m compileall .
and then installed by typing pip install .
However it can't find the module when i try to import it in my application.
ImportError: No module named...
What do you suggest to solve?
Thanks
I guess it is to do with setuptools not packaging up *.pyc files, because normally you don't want them.
You should create a file MANIFEST.in with the content
global-include *.py[co]
global-exclude *.py
This tells setuptools to exclude *.py source files and include *.pyc compiled files.
Afterwards create a source distribution package
python setup.py sdist
or a wheel
python setup.py bdist_wheel
which also compiles C extensions.

Installing Python Module to non-root directory

First time posting on this site.
I'm trying to install a python module named Pygments into my local directory at work (non-root). I am using C Shell, so i changed default path using
setenv PYTHONPATH "~/usr/lib/python2.4/site-packages:${PYTHONPATH}"
(with usr/lib/... being self-made empty directories made to mimic the system's hierarchy at my boss's suggestion). I attempted to run
python setup.py install
however, I got the following error.
/usr/lib64/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
/usr/lib64/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
running install
running build
running build_py
running build_scripts
running install_lib
creating /usr/local/lib64
error: could not create '/usr/local/lib64': Read-only file system
I want the module to install to my local directory and not to any root directory. I've been stuck on this for a couple of days. Any help would be greatly appreciated.
Colten
Extra Information: I have setup.py in ~/Pygments-1.6, and I only have write access to directories within ~/.
PYTHONPATH is where python looks for modules, not where it chooses to install modules. You need to specify that on the setup.py line:
python setup.py install --prefix=${HOME}/usr/
or something similar. Another thing that you'll see in these cases is:
python setup.py install --user
which will put it in: '${HOME}/.local/lib/pythonX.Y/site-packages' (And I believe that this path should be searched by python for modules by default.)

Unable to install pywinauto tool

Unable to install pywinauto with below error. Please help me to over come this.
C:\Python27>python C:\Users\........\Downloads\pywinauto-0.4.0\pywinauto-0.4.
0\setup.py install
running install
running build
running build_py
error: package directory 'pywinauto' does not exist
The way I did it was this:
Extracted the .zip file
Moved the folder into:C:\Python27\Lib\site-packages
Ran setup.py by going into the folder and double-clicking it.
That worked for me, and that is the normal way of moving modules into Python.
try this
Downloaded http://www.python.org/download/releases/2.6.6/ (32 bit)
Installed python using python-2.6.6.msi
Install send keys
https://code.google.com/p/pythonxy/downloads/detail?name=SendKeys-0.3_py26.exe&can=2&q=
Downloaded
http://sourceforge.net/projects/pywinauto/files/pywinauto/0.4.0/
Unzip the pywinauto zip file to a folder
Run python.exe setup.py install
C:\Software\pywinauto-0.4.0\pywinauto-0.4.0>C:\Python26\python.exe
setup.py install
This issue :"error: package directory 'pywinauto' does not exist" appears if you start setup process from wrong work dirrectory.
In my case (Win7x64, ActivePython2.7.2) I got same issue till I done next:
*precondtion: you should install Python first
1) go in PowerShell to directory with unzipped PyWinAuto: "cd: C:\Python27\Lib\site-packages\pywinauto"
you should navigate to folder with unzipped PyWinAuto
2) then do "python setup.py install"
Then you can check for installed PyWinAuto:
1) "import application"
2) "app = application.Application().start_("notepad")"
notepad.exe should appears

Setup tools install command differences

What are the differences between the below commands
python setup.py install develop
Doesn't work for me error No such file or directory: 'build/bdist.macosx-10.7-intel/egg/test-easy-install-37886.pth'
python setup.py develop
Works for me appears to make an .egg link file
python setup.py install
Works for me appears to make a .egg file which in .zip file format
Develop is a setuptools / distribute feature that allows you to add a project
to your Python environment without installing it - so you can continue
its "development"
In other words, when you call "python setup.py develop", setuptools will
compile the metadata and hook your project into Python's site-package,
but the packages and modules that will be used are the one in the
directory where you've run that command.
This is useful to continue working on your code and testing it without
having to run "python setup.py install" on every run
With develop, Python 'pseudo-installs' a package by running the setup.py script instead of install. The difference is a modification of the environment (it doesn't with develop), so a package can be imported from it's current location instead of a site-package directory. The advantage of this is you can develop packages that are being used by other packages, and you can modify source code in place with develop.
As far as "setup.py install develop", I've never seen anyone use that before, sorry.
source
source
source
python setup.py install develop
Is a wrong command.
When you use develop you use the current code when you run your application.
When you useĀ install and then modify you code, your modifications will not be taken in account while running your app. until you rerun install or develop.

Categories

Resources