Difficulty installing and using Mercurial Chart extension - python

Hi I'm having trouble installing and using the Mercurial ChartExtension
When I installed it as per instructions
First you need to install the extension; type this in your shell:
python ./setup.py install
Blockquote
I then modified my mercurial.ini file as follows
[extensions]
chart=/path/to/chart.py
Blockquote
Then tried running Hg Chart command and got the following error
Can anyone help me get this extension working. I know there's the Hg ActivityExtension as well, but i have not had much luck with that either Problem installing Mercurial Activity extension
A layman's guide to what steps i need to follow would be of immense help

Based on the changelog, the Chart extension has not been updated since late 2008. It would probably work if you tried using it with a version of Mercurial released around that same time (Mercurial v1.1.2 was released on Dec. 30, 2008).
The latest version of Mercurial is now v1.9.2. The API has changed (probably quite a bit) since v1.1.2. If the extension has not been modified to keep up with the changes to the API, then it will fail in ways similar to the error you found. In this case, the number of arguments for the walkchangerevs method has changed.
Updating the extension could be a large task...there is no way to know without inspecting the code. You could try to contact the author (#Ry4an) and ask for help. You could also try to modify the extension yourself.

Related

Programmatically check if wheel is compatible with Python installation

Is it possible to programmatically check if a wheel (whl) is compatible with the chosen Python installation before attempting to install?
I'm making an automated packages installer (packages needed for my Python project to work), and I need to only attempt to install compatible pkgs, so if there are errors, I know they are only from the compatible modules and I should see what happened (not errors also from incompatible pkgs, which I wouldn't care). Example: I'd have wheels for Python 3.5 and 3.7, and in a 3.5 installation, 3.7 wheels could not be tried to be installed.
I've tried pkginfo (https://pypi.org/project/pkginfo/), but on wheel.supported_platforms, it returns an empty array and I can't do anything with that (a wheel with "any" or with "win32" on their name in the platform part, returned an empty array, so I can't use that, it seems).
Also tried the output from python -m pip debug --verbose, but the following appears:
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without no
tice.
This makes the command not possible to use, even though bellow that it prints the "Compatible tags", which more or less I could use to determine if a wheel is supported or not from its name. Example of those "Compatible tags" in a Python array:
['cp39-cp39-win_amd64', 'cp39-abi3-win_amd64', 'cp39-none-win_amd64', 'cp38-abi3-win_amd64', 'cp37-abi3-win_amd64', 'cp36-abi3-win_amd64', 'cp35-abi3-win_amd64', 'cp34-abi3-win_amd64', 'cp
33-abi3-win_amd64', 'cp32-abi3-win_amd64', 'py39-none-win_amd64', 'py3-none-win_amd64', 'py38-none-win_amd64', 'py37-none-win_amd64', 'py36-none-win_amd64', 'py35-none-win_amd64', 'py34-no
ne-win_amd64', 'py33-none-win_amd64', 'py32-none-win_amd64', 'py31-none-win_amd64', 'py30-none-win_amd64', 'cp39-none-any', 'py39-none-any', 'py3-none-any', 'py38-none-any', 'py37-none-any
', 'py36-none-any', 'py35-none-any', 'py34-none-any', 'py33-none-any', 'py32-none-any', 'py31-none-any', 'py30-none-any']
With, for example, "pyHook-1.5.1-cp36-cp36m-win32.whl", I could check the name and see if it's compatible or not (except because of the warning above...).
Any other ideas?
Thanks in advance for any help!
EDIT: I could go manually and pull things from the name and hard-code the some possibilities I see on documentation, like "win32" and "win_amd64" (as I did before), but then I'd need to know exactly all the possibilities that the parts of the name can have (I saw a cool expression on the documentation: "e.g." - which means there are more than the mentioned things) and have a lot of work on that. I was hoping there was already someone that had made such thing (maybe even Python itself has some way in any of its internal packages).
You can do this using packaging.
pip install packaging
An example code to get the tags similar to how you got from pip would be:
from packaging.tags import sys_tags
tags = sys_tags()
print([str(tag) for tag in tags])
# ['cp39-cp39-manylinux_2_33_x86_64', 'cp39-cp39-manylinux_2_32_x86_64', 'cp39-cp39-manylinux_2_31_x86_64', ..... , 'py31-none-any', 'py30-none-any']
Of course, you can do much more things programmatically with the above variable tags:
>>> tags = sys_tags()
>>> for tag in list(tags)[:3]:
... print(tag.interpreter, tag.abi, tag.platform)
...
cp39 cp39 manylinux_2_33_x86_64
cp39 cp39 manylinux_2_32_x86_64
cp39 cp39 manylinux_2_31_x86_64
For more in-depth documentation, check: https://packaging.pypa.io/en/latest/tags.html#packaging.tags.sys_tags

Cstdint Missing Error When Installing Pydaedalus with PiP

I am working on an application which involves route finding (a completely different subject), but for testing I need example mazes to test on. A colleague suggested I use pydaedalus to generate large scale mazes in the format I need. I am using the following code to try and install the module:
$pip3.6 install pydaedalus
This returns the following error:
-Wno-error=format-security
In file included from daedalus/_maze.cpp:467:
In file included from daedalus/wrapper.h:8:
daedalus/src/util.h:31:10: fatal error: 'cstdint' file not found
#include <cstdint>
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
I have done some research and have found nothing which addresses this. I have also done some (limited) C++ development using cstdint, which has always worked.
I came across this question, but it appears to address a separate issue.
I am developing in OSX 10.10.5
Any help that you can provide is much appreciated!
These compile errors are down to daedalus's requirement of the C++11 standard, which is sometimes a bit tricky to get working on Mac OS X. One idea might be to check to make sure your Xcode is completely up to date.
The page you linked also suggests to try linking against clang's standard library instead of the GCC standard library. I'm not sure if this will work, or if it will give you linking errors on build or when you import daedalus into python, but you could give it a shot anyway:
CFLAGS='-stdlib=libc++' pip3.6 install pydaedalus
Another idea would be to encourage pip to use the clang++ frontend, which your link also suggests might help. You should be able to set this with the environment variable CXX (or, just possibly, CC).
CXX=clang++ pip3.6 install pydaedalus
Try various combinations of those environment settings (e.g., CXX and CFLAGS), and hopefully something will work eventually.

Issue downloading Python Panda's module

I am a programming novice, so apologize in advance if I'm asking a dumb question or perpetrating some site etiquette violation. I have tried very hard to research the answer to my question on an issue that seems to be very common, but none of the proposed solutions have worked, so am looking for some help as I just don't know what to try next.
I'm trying to import Panda from iPython onto Windows 8. I have version 2.7 of Python and have successfully downloaded Numpy. Given the suggestions on this site, I have downloaded all the file that I think Panda is dependent on (pytx, dateutil, setuptools), but it still didn't work: the error message includes:
Import Error Traceback (most recent call)
<ipython-input-2-d6ac987968b6> in <module>()
try
from.import hashtable, tslib, lib
except exception: # pragma: no cover
import datetime
- C: \Python27\lib\site-packages\pandas\__init__.py in <module>():
Import Error: No module named six
Out of desperation, I also deleted all previous version of pandas and loaded Aneconda, thinking from previous responses that might help capture all required modules including Pandas, but the same error keeps coming up.
Any help would be much appreciated, and don't worry about pointing out the obvious (since it's clearly not obvious to me.)
The easiest way to get modules up and running on Windows is to use Christoph Gohlke's Python Extension Packages for Windows repository. It includes installers for a ton of (mainly scientific-related) modules, including pandas, matplotlib, six, etc. Since many modules included compiled extensions, installing using pip doesn't always work if the package maintainer hasn't published a binary for your package of interest. Gohlke's packages include everything already pre-compiled, you just need to choose the version and bit-ness of Python, and download the .exe files.

Upgrading OpenCV brew formula: Python not loading properly

I'm trying update the latest opencv formula (as of writing, this formula installs opencv 2.4.7) to build the latest version of opencv (2.4.8).
The first thing I did was brew edit opencv, and change the url to 'https://github.com/Itseez/opencv/archive/2.4.8.tar.gz' and update the checksum. I anticipated that I might have to deal with some built issues, but the problem I see seems to occur while the formula is being run.
Specifically, when I run brew upgrade opencv (or unlink and run brew install opencv), I get the following message:
==> Downloading https://github.com/Itseez/opencv/archive/2.4.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.8.tar.gz
==> Patching
patching file cmake/OpenCVFindOpenNI.cmake
Warning: Formula#python is deprecated and will go away shortly.
Error: undefined method `incdir' for #<PythonDependency: "python" []>
Please report this bug:
https://github.com/Homebrew/homebrew/wiki/troubleshooting
/usr/local/Library/Formula/opencv.rb:49:in `install'
/usr/local/Library/Homebrew/build.rb:165:in `install'
/usr/local/Library/Homebrew/formula.rb:272:in `brew'
/usr/local/Library/Homebrew/formula.rb:617:in `stage'
/usr/local/Library/Homebrew/resource.rb:63:in `unpack'
/usr/local/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/usr/local/Library/Homebrew/resource.rb:60:in `unpack'
/usr/local/Library/Homebrew/resource.rb:53:in `stage'
/usr/local/Library/Homebrew/formula.rb:615:in `stage'
/usr/local/Library/Homebrew/formula.rb:267:in `brew'
/usr/local/Library/Homebrew/build.rb:144:in `install'
/usr/local/Library/Homebrew/build.rb:45:in `main'
/usr/local/Library/Homebrew/build.rb:12
/usr/local/Library/Formula/opencv.rb:80
Python doesn't seem to get loaded. I'm also confused by the deprecation warning; everything I've found suggests that python formula is the one I should be using. Judging by this link the depends_on :python dependency seems like it should work (and it obviously did when I tried with the previous 2.4.7.1 formula).
For reference, here are my environment variables:
Apple_PubSub_Socket_Render=/tmp/launch-Ygtqzn/Render
CMD_DURATION=20.7s
COMMAND_MODE=unix2003
DISPLAY=/tmp/launch-a4CGwS/org.x:0
GEM_HOME=/Users/myname/.rvm/gems/ruby-1.9.3-p194
GEM_PATH=/Users/myname/.rvm/gems/ruby-1.9.3-p194:/Users/myname/.rvm/gems/ruby-1.9.3-p194#global
GREP_COLOR=97;45
GREP_OPTIONS=--color=auto
HOME=/Users/myname
LANG=en_CA.UTF-8
LOGNAME=myname
PATH=/usr/local/bin:/Users/myname/.rvm/gems/ruby-1.9.3-p194/bin:/Users/myname/.rvm/gems/ruby-1.9.3-p194#global/bin:/Users/myname/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/myname/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin:/Users/myname/.rvm/bin:/usr/local/heroku/bin
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
PWD=/Users/myname/projects/forks/ruby-opencv
SHELL=/usr/local/bin/fish
SHLVL=1
SSH_AUTH_SOCK=/tmp/launch-lvn79S/Listeners
TERM=xterm-color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=273.1
TMPDIR=/var/folders/pv/pvvR8qgvGOCfd5dza+ZbVU+++TI/-Tmp-/
USER=myname
__CF_USER_TEXT_ENCODING=0x1F5:0:0
__fish_bin_dir=/usr/local/Cellar/fish/2.0.0/bin
__fish_datadir=/usr/local/Cellar/fish/2.0.0/share/fish
__fish_help_dir=/usr/local/Cellar/fish/2.0.0/share/doc/fish
__fish_sysconfdir=/usr/local/Cellar/fish/2.0.0/etc/fish
rvm_bin_path=/Users/myname/.rvm/bin
rvm_path=/Users/myname/.rvm
rvm_prefix=/Users/myname
rvm_version=1.25.3:master
And python (homebrewed) version
python --version #=>Python 2.7.6
brew doctor output gives me a warning about a passenger config file (which shouldn't influence the building of opencv) and a warning that opencv is unlinked (I unlinked it to try running brew install opencv)
Thanks in advance for the help.
I had the same error. I don't understand why "incdir" or other variables are not defined correctly in the formula file. But I solved this error by editing the opencv formula file as follows, (setting each path directly)
(around 50th lines)
DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7
DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
DPYTHON_EXECUTABLE=/usr/local/bin/python
I worked around this issue by rolling back to an earlier homebrew version, then installing opencv, and then going back to the current version.
See this gist for detailed instructions: https://gist.github.com/frederikhermans/8561382

Mercurial installation issue

We've installed mercurial 1.4.1 and python 2.6.2 on a solaris 8 box. Now some hg commands work as expected, others fail.
I was able to initialize a repository (hg init) and add a file (hg add) but the committing (hg commit) leads to an error message:
abort: could not import module found!
I need a hint where to look - I'm not a python expert, is this missing found module part of the python distribution or does it belong to mercurial? Any idea how to fix it?
Edit
Thanks for your comments - hg debuginstall runs fine, just reports one problem - I didn't set a username in any of the config files. Can't believe that this causes the actual problems...
Edit
--traceback was a good hint!!
Here's the last line (can't copy&paste):
ImportError: ld.so.1: hg: fatal: relocation error:
file:/usr/local/lib/python2.6/lib-dynload/zlib.so:
symbol inflateCopy: referenced symbol not found
The zlib.so library is present was installed with either the python or mercurial package.
Looks like I'm not the only one: here's the same problem with python 2.5 on solaris 10
You need to install the zlib library for your system (libz.so).
Check your LD_LIBRARY_PATH settings.
If it is pulling libz from an odd place you will need to fix it so that it is pulling from /pkg/local/lib first
I was seeing this:
ldd /pkg/local/lib/python2.7/lib-dynload/zlib.so
libz.so => /import/wgs/lib/libz.so
But now its working for me.

Categories