I am working on a project that requires retrieving information from a webpage. Since the webpage uses javascript redirects, my friend recommended I use mechanize in Python. (Can anyone confirm that mechanize can handle javascript redirects or suggest a better HTML parser?) Anyway, I installed easy_install through the Python script and then ran "easy_install mechanize" in the command prompt successfully. However, when I do:
import mechanize
I get the following error:
Unresolved import: mechanize
I read that it might be because I need to add my scripts folder to the environment path, which I think I have. As a beginner to HTML parsing I find the mechanize installation instructions and troubleshooting page really complicated so any help would be appreciated!
What version of python are you using? Are you running python in eclipse? It seems that the Unresolved import is an eclipse pydev error.
Related
I'm trying to use Google Cloud Storage with App Engine Standard (Python 2.7).
I've been trying to follow the simple 4-step installation instructions here: https://cloud.google.com/appengine/docs/legacy/standard/python/migrate-to-python3/migrate-to-storage-apis#install
After following the instructions, when trying to run, I get a message "ImportError: No module named pkg_resources" caused by the import pkg_resources at the top of appengine_config.py. I don't understand how this is supposed to work, since the vendor.add call comes later in the file, so the pkg_resources installed in lib is not yet available. If pkg_resources is supposed to be present elsewhere, where? Somewhere in the app engine installation? How would it get there?
I do already have other third-party libraries installed and working in lib, so that part of the configuration is probably ok. That being said, these instructions do install A LOT of libraries into this app-specific lib folder, which I'd love to avoid if possible.
Anyway, I can work around this pkg_resources problem by importing pkg_resources after the vendor.add call (but it leaves me concerned that the instructions aren't working).
With the workaround, I then get "ImportError: No module named moves" from file C:\Python27\lib\site-packages\google\cloud_helpers.py, line 29, in 'from six.moves import http_client`. There is no "six" folder in "lib", only "six.py".
I feel as if I may be missing something, since the original instructions are so simple, yet not working for me. Can anyone help?
I am trying to start a new PyDev Project and first need to setup the interpreter. The auto-config does not find a "valid interpreter". And so I must manual config. Perhaps someone with experience in this procedure knows of the specific name for the Interpreter Executable I am looking for. Thanks!
To get the interpreter you need to use, start the python interactive console in a shell and then do:
import sys; print(sys.executable)
The path printed is the interpreter you should use.
As a note, PyDev 4.6.0 is pretty old already, so, my suggestion would be upgrading to the latest release as many things were improved in the meanwhile.
Dear all I try to get XML RPC running on Bugzilla. I installed all perl modules what has been described by mozilla. but when I like to access the perl cgi script http://localhost:8010/xmlrpc.cgi I get the following error.
Can't load 'C:/Strawberry/perl/vendor/lib/auto/XML/Parser/Expat/Expat.xs.dll' for module XML::Parser::Expat: load_file:the requested modul get not found at C:/Strawberry/perl/lib/DynaLoader.pm line 193.
I verified the mentioned dll file is existign at the place C:/Strawberry/perl/vendor/lib/auto/XML/Parser/Expat/Expat.xs.dll. Here I assume the dll may require other dependent dll and other perl modules. Apache log file does not show me any additional information.
Any hint what I can do?
I am using
Strawberry Perl v5.22.1 (64bit)
Bugzilla v4.4.11
Apache v2.4
Windows 10
I opened a bug on the mozilla page for bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=1240367
The support answered me that strawberry is not supported for bugzilla v4.4 however I could solve the problem by copying the C:\Strawberry\c\bin\libexpat-1__.dll to C:\Strawberry\perl\vendor\lib\auto\XML\Parser\Expat\libexpat-1__.dll (same directory as Expat.xs.dll is located). After that the XML Parser stuff and Expat.xs.dll could be executed properly.
May be it helps for others. Regards
I think the right answer should be:
add the folders
C:\{PerlFolder}\c\bin\
C:\{PerlFolder}\perl\bin
to the path under environment variables.
where {PerlFolder} in your case is "Strawberry"
same pb, solved by adding perl\bin in path
I am trying to get work PostgresSQL with PHP, but i stuck on that apache error:
Call to undefined function pg_connect().
When i run phpinfo() i cannot see that my module is loaded, but i do not know why. The pgsql.ini files were loaded. And when i open them, i can see, that the extension is enabled extension=pgsql.so. Under /usr/lib64/php5/extensions there is the .so file. Even the permission are same like the other modules.
Any idea what am I doing wrong?
It would help if you could describe what operating system you are using. I'm assume Linux, but which distribution? One package that is often forgotten when installing postgresql and php is php5-pgsql. This is the connection between the two. For some reason I cannot explain, it is best if all three are installed together. So I suggest uninstalling postgresql and php and then installing postgresql, php5 and php5-pgsql. I hope this works for you!
I found it out. Some libraries where not found.
1.) First of all run php -version
2.) If there is an error where it described that some libraries are missing, you can solve it like me
3.) Search for the files on your system find / -name {LIBRARY NAME}
3a.) If you found them, just create a symlink to /usr/lib64
3b.) If not, find a way to get them and 3 3a
I want to import bugs in bugzilla db from xml file and i got error message after run the following command.
perl -T C:\bugzilla\bugzilla\importxml.pl -v C:\bugzilla\bugzilla\mybugs\bug.xml
"ERR: can not import these bugs because bug import is disabled here"
Now I found that XML::Twig module is only required to import XML bugs usin the importxml.pl script.
I've downloaded XML-Twig-3.39 from CPAN Download Page: http://search.cpan.org/dist/XML-Twig/
but i don't know how to configure it with bugzilla ?
any help would be appreciated.
Plz share your knowledge, if anyone knows?
Regards,
I found the solution.
move-enabled radio button in bugzilla administration needs to turn on.
Administration -> Parameters -> Bug Moving -> move-enabled.
#simbabque: your comment was really helpful, and suggested tool PPM is really great. thanks.