tortoisehg import module error - mercurial

I get an error when i running my tortoisehg - python : "*** failed to import extension hgcr-gui-qt: cannot import name updatedir". how to correct it ?

AFAICS, all traces of this error show us summer of 2011 and THG 2.0.* and THG 1.9 and status FIXED
#30131 (tortoisehg 2.0.4 won't start with mercurial 1.9.x) – MacPorts
hg 1.9 breaks thg 2.0.5?
tortoisehg: TortoiseHG cannot start
Maybe, it's time to update (TortoiseHg version 2.3.1 with Mercurial-2.1.1, Python-2.6.6, PyQt-4.8.6, Qt-4.7.4 is latest today) and check error again (and ask good question, if error still exist in your case)?

Related

trio + httpx gives TrioDeprecationWarning

The following testcase gives a warning:
import trio, httpx
async def amain():
async with httpx.AsyncClient() as client:
r = await client.get('https://icanhazip.com/')
print(r.text)
trio.run(amain)
Output:
> python test.py
/path/to/.venv/lib/python3.10/site-packages/anyio/_backends/_trio.py:164:
TrioDeprecationWarning: trio.MultiError is deprecated since Trio 0.22.0;
use BaseExceptionGroup (on Python 3.11 and later) or exceptiongroup.BaseExceptionGroup
(earlier versions) instead (https://github.com/python-trio/trio/issues/2211)
class ExceptionGroup(BaseExceptionGroup, trio.MultiError):
193.37.32.201
Fresh .venv using latest Python (installed with latest pyenv (installed with up-to-date brew)).
pip show trio reports 0.22.0. pip show httpx reports 0.23.0. Both of these are latest releases on pypi.
What's going on here? And how to silence the warning?
I raised this in https://github.com/encode/httpx/discussions/2409
To silence the warning:
import warnings
from trio import TrioDeprecationWarning
warnings.filterwarnings(action='ignore', category=TrioDeprecationWarning)
As far as I understand, lastest Trio release is using some exception-handling machinery that's only just been added into Python in 3.11.0, which hasn't been released yet (it SHOULD have been, but release-date got pushed back). Presumably that's what has created this unusual situation, where a deprecation warning requires a Python-version that does not yet exist.

nltk Stanford Segmenter : NoClassDefFoundError: org/slf4j/LoggerFactory (Windows)

I'm relatively new at this. Trying to get Stanford Segmenter to play well with nltk and keep running into this error I havent been able to resovle.
This is the error:
CRFClassifier invoked on Tue Jan 19 17:39:25 CET 2016 with arguments:
-sighanCorporaDict C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data -textFile C:\Users\NGBENE\AppData\Local\Temp\tmpmti8l2nb -sighanPostProcessing true -keepAllWhitespaces false -loadClassifier C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/pku.gz -serDictionary C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/dict-chris6.ser.gz -inputEncoding UTF-8
serDictionary=C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/dict-chris6.ser.gz
loadClassifier=C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/pku.gz
sighanCorporaDict=C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data
inputEncoding=UTF-8
textFile=C:\Users\AppData\Local\Temp\tmpmti8l2nb
sighanPostProcessing=true
keepAllWhitespaces=false
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
I have python3.4
I've reinstalled the nltk (current version 3.1)
I've added the classpath of the slf4j-api.jar (any other .jar i need to add?)
import os
javapath = "C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/slf4j-api.jar"
os.environ['CLASSPATH'] = javapath
Still doesn't work. Any ideas?
Thanks alot!
UPDATE:
Uninstalled: stanford-segmenter-2015-12-09
Installed: stanford-segmenter-2014-08-27
Followed the test code from here:
http://textminingonline.com/dive-into-nltk-part-vi-add-stanford-word-segmenter-interface-for-python-nltk
Works!
Seems like it might be a problem with the new version.

unable to install nex/yii2-chosen extension

I am unable to install nex/yii2-chosen extension in my project using composer please.
My composer shows :
C:\xampp\htdocs\labplus>composer require nex/yii2-chosen Deprecation
Notice: The Composer\Package\LinkConstraint\MultiConstraint class is
deprecated, use Composer\Semver\Constraint\MultiConstraint instead. in
phar://C
:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstrain
t/MultiConstraint.php:17 Deprecation Notice: The
Composer\Package\LinkConstraint\LinkConstraintInterface interface is
deprecated, use Composer\Semver\Constraint\ConstraintInterface inst
ead. in
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Packa
ge/LinkConstraint/LinkConstraintInterface.php:17 Failed to decode
response: zlib_decode(): data error Retrying with degraded mode, check
https://getcomposer.org/doc/articles/troubles hooting.md#degraded-mode
for more info Using version dev-master for nex/yii2-chosen
./composer.json has been updated Loading composer repositories with
package information Updating dependencies (including require-dev) Your
requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package dbtek/chosen-bootstrap could not be found in any ver sion, there may be a typo in the package name. Problem 2
- The requested package nex/yii-chosen could not be found in any version, th ere may be a typo in the package name.
Installation failed, reverting ./composer.json to its original
content.
see the cmd snap for more

I think OSX-gcc-installer broke some things and I'm not sure what to do

Long story short is I foolishly installed OSX-gcc-installer about a month ago and at first it prevented me, I believe, from installing Ruby gems on my machine. With the help of someone I did get this one issue fixed. Going through other the other posts on this website I was not able to find the solution that I'm looking for, so I decided to post here.
When I run brew doctor I get the following:
albys-mbp:folder alby$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.
Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/bin/aclocal
/usr/local/bin/aclocal-1.14
/usr/local/bin/autoconf
/usr/local/bin/autoheader
/usr/local/bin/autom4te
/usr/local/bin/automake
/usr/local/bin/automake-1.14
/usr/local/bin/autoreconf
/usr/local/bin/autoscan
/usr/local/bin/autoupdate
/usr/local/bin/cscope
/usr/local/bin/erb
/usr/local/bin/gem
/usr/local/bin/glibtool
/usr/local/bin/glibtoolize
/usr/local/bin/gpg-error
/usr/local/bin/gpg-error-config
/usr/local/bin/ifnames
/usr/local/bin/irb
/usr/local/bin/ksba-config
/usr/local/bin/ocs
/usr/local/bin/pkg-config
/usr/local/bin/rake
/usr/local/bin/rdoc
/usr/local/bin/ri
/usr/local/bin/ruby
/usr/local/bin/testrb
/usr/local/include/gpg-error.h
/usr/local/include/ksba.h
/usr/local/include/libltdl
/usr/local/include/ltdl.h
/usr/local/include/ruby-2.1.0
/usr/local/include/yaml.h
/usr/local/lib/libgpg-error.0.dylib
/usr/local/lib/libgpg-error.dylib
/usr/local/lib/libksba.8.dylib
/usr/local/lib/libksba.dylib
/usr/local/lib/libltdl.7.dylib
/usr/local/lib/libltdl.a
/usr/local/lib/libltdl.dylib
/usr/local/lib/libruby.2.1.0-static.a
/usr/local/lib/libruby.2.1.0.dylib
/usr/local/lib/libruby.2.1.dylib
/usr/local/lib/libruby.dylib
/usr/local/lib/libyaml-0.2.dylib
/usr/local/lib/libyaml.a
/usr/local/lib/libyaml.dylib
/usr/local/lib/pkgconfig/ruby-2.1.pc
/usr/local/lib/pkgconfig/yaml-0.1.pc
/usr/local/lib/ruby/2.1.0
/usr/local/lib/ruby/gems
/usr/local/share/aclocal/README
/usr/local/share/aclocal/argz.m4
/usr/local/share/aclocal/dirlist
/usr/local/share/aclocal/gpg-error.m4
/usr/local/share/aclocal/ksba.m4
/usr/local/share/aclocal/libtool.m4
/usr/local/share/aclocal/ltdl.m4
/usr/local/share/aclocal/ltoptions.m4
/usr/local/share/aclocal/ltsugar.m4
/usr/local/share/aclocal/ltversion.m4
/usr/local/share/aclocal/lt~obsolete.m4
/usr/local/share/aclocal/pkg.m4
/usr/local/share/aclocal-1.14
/usr/local/share/autoconf
/usr/local/share/automake-1.14
/usr/local/share/common-lisp
/usr/local/share/doc/automake
/usr/local/share/doc/pkg-config/pkg-config-guide.html
/usr/local/share/emacs
/usr/local/share/info/gpgrt.info
/usr/local/share/info/ksba.info
/usr/local/share/info/libtool.info
/usr/local/share/info/libtool.info-1
/usr/local/share/info/libtool.info-2
/usr/local/share/libtool
/usr/local/share/man/man1/aclocal-1.14.1
/usr/local/share/man/man1/aclocal.1
/usr/local/share/man/man1/autoconf.1
/usr/local/share/man/man1/autoheader.1
/usr/local/share/man/man1/autom4te.1
/usr/local/share/man/man1/automake-1.14.1
/usr/local/share/man/man1/automake.1
/usr/local/share/man/man1/autoreconf.1
/usr/local/share/man/man1/autoscan.1
/usr/local/share/man/man1/autoupdate.1
/usr/local/share/man/man1/config.guess.1
/usr/local/share/man/man1/config.sub.1
/usr/local/share/man/man1/cscope.1
/usr/local/share/man/man1/erb.1
/usr/local/share/man/man1/glibtool.1
/usr/local/share/man/man1/glibtoolize.1
/usr/local/share/man/man1/gpg-error-config.1
/usr/local/share/man/man1/ifnames.1
/usr/local/share/man/man1/irb.1
/usr/local/share/man/man1/pkg-config.1
/usr/local/share/man/man1/rake.1
/usr/local/share/man/man1/ri.1
/usr/local/share/man/man1/ruby.1
/usr/local/Library/LinkedKegs/autoconf
/usr/local/Library/LinkedKegs/automake
/usr/local/Library/LinkedKegs/cscope
/usr/local/Library/LinkedKegs/libgpg-error
/usr/local/Library/LinkedKegs/libksba
/usr/local/Library/LinkedKegs/libtool
/usr/local/Library/LinkedKegs/libyaml
/usr/local/Library/LinkedKegs/pkg-config
/usr/local/Library/LinkedKegs/ruby
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install openssl
Run `brew missing` for more details.
alby-mbp:folder alby$
As you can also see above, I am missing openssl. This is because I uninstalled it and attempted to reinstall it thinking that this would help, but I was not able to reinstall. Here is what I get when I try to do brew install openssl:
albys-mbp:folder alby$ brew install openssl
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.
Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl-1.0.1j_1.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/openssl-1.0.1j_1.mavericks.bottle.tar.gz
Error: SHA1 mismatch
Expected: 65e125a4777eb6dfb63f01a18f724246123dd79e
Actual: eac5e2d21af64224fc533ebb793b99a2aea434c7
Archive: /Library/Caches/Homebrew/openssl-1.0.1j_1.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Warning: Bottle installation failed: building from source.
==> Installing openssl dependency: makedepend
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/makedepend-1.0.5.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/makedepend-1.0.5.mavericks.bottle.tar.gz
Error: SHA1 mismatch
Expected: 83db1daee01e4eb752c711934eb88850b3ee70d6
Actual: eac5e2d21af64224fc533ebb793b99a2aea434c7
Archive: /Library/Caches/Homebrew/makedepend-1.0.5.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Warning: Bottle installation failed: building from source.
Error: /usr/local/opt/pkg-config not present or broken
Please reinstall pkg-config. Sorry :(
albys-mbp:folder alby$
Another issue is that when I try and run mysql in bash, I get the following:
albys-mbp:folder alby$ mysql
dyld: Library not loaded: ##HOMEBREW_PREFIX##/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/bin/mysql
Reason: image not found
Trace/BPT trap: 5
albys-mbp:folder alby$
I am mostly new to programming and am not sure where to begin to solve this issue. I was able to backup my HD to an external HD, but this is after installing the gcc-installer which overwrote my Command Line Tools. So even if I were to do a reinstall, would that even work? I've never had to reinstall my OS X before; would I be able to pick and choose files from the external HD or is it all restored?
Also, I have OS X 10.9.
Thanks!

JSON/RPC/Client.pm Missing - Fedora 17

I want to run a JSON request using Zabbix API, but I get the following error:
Can't locate JSON/RPC/Client.pm in #INC (#INC contains: /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
/usr/lib64/perl5 /usr/share/perl5 .) at ./test.perl line 6.
I'am using Fedora 17 and don't find the package named: libjson-rpc-perl. I've already installed the following packages:
perl-CGI-Application-Plugin-JSON.noarch 1.02- 5.fc17 fedora
perl-Catalyst-View-JSON.noarch 0.30-5.fc17 fedora
perl-JSON-Any.noarch 1.29-1.fc17 fedora
perl-JSON-Any-tests.noarch 1.29-1.fc17 fedora
perl-JSON-PP.noarch 2.27200-3.fc17 fedora
perl-JSON-Path.noarch 0.101-2.fc17 fedora
perl-JSON-RPC-Daemon.noarch 1.03-2.fc17 updates
perl-JSON-RPC-legacy.noarch 1.01-2.fc17 fedora
perl-JSON-RPC-legacy-server.noarch 1.01-2.fc17 fedora
perl-JSON-Util.noarch 0.05-3.fc17 fedora
perl-JSON-XS.x86_64 1:2.32-1.fc17 fedora
perl-JSON-XS-tests.x86_64 1:2.32-1.fc17 fedora
perl-JSON-tests.noarch 2.53-4.fc17 fedora
perl-MooseX-Types-JSON.noarch 0.02-7.fc17 fedora
perl-MooseX-Types-JSON-tests.noarch 0.02-7.fc17 fedora
perl-Test-CPAN-Meta-JSON.noarch 0.13-1.fc17 fedora
perl-Test-JSON.noarch 0.11-6.fc17 fedora
perl-Test-JSON-tests.noarch 0.11-6.fc17 fedora
I don't know what to do now ? Can you please advice ?
Thanks in advance,
in your code :
use JSON::RPC::Legacy::Client;
and also change:
my $client = new JSON::RPC::Legacy::Client;
Use CPAN to install JSON::RPC. It's usually simple procedure. There is also a tool somewhere that converts CPAN distributions into rpms, but you might find cpan easier to handle without additional conversion step.
In general, in Fedora (and anywhere else in the Red Hat world), if you don't know which package contains the module you need, you can run:
% yum install 'perl(Module::Name)'
In this case, that would be:
% yum install 'perl(JSON::RPC::Client)'
JSON::RPC::Client was provided by an older version of JSON-RPC. Version 1.00 of JSON-RPC broke backwards compatibility with previous releases and no longer includes that module. You'd have to install the older version to get this code to work (or update the code to use the new API). You can get JSON-RPC 0.96 (the last compatible version) here.
You can install the old version in a private location just for this code.