find_namespace: directive is unsupported on Python < 3.3 - python

There's much more to the problem than the title suggests, so I'm just going to start from the beginning.
I'm trying to install google.colab, and when I type pip3 install google.colab, I get the following error:
python setup.py egg_info did not run successfully. │ exit code: 1
I googled this error and I followed all the instructions on this post, which matches up with the advice on most other posts and websites, however for the first few bits of the instructions, it says I already have those things installed. I finally got around to easy_install -U setuptools, it gives me the error in the title, find_namespace: directive is unsupported on Python < 3.3.
I've double checked and I have python 3.11 installed. I can't uninstall python 2.7 entirely, but I followed the instructions on this post.
How do I remedy this? I've googled stuff about namespaces, and it went over my head. I'm fairly new to python.

Related

Debugging Installing LXML for Python 2.x on Windows

I have absolutely no experience programming Python, but I'm trying to set up some modules to implement this project, and am seriously struggling with lxml. I've hunted through a lot of help forums trying to figure out how to go about getting lxml set up, and none of the solutions have helped so far.
Things I've tried:
Downloading the lxml file from this website. I'm running Python 2.7.9, and have tried using both cp27 files from that website. Both give me the same message:
lxml-4.3.3-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
After more hunting, it seemed like the command:
python -m pip install lxml
should be a viable alternative. However, this leads to these error messages (not the full output for space conservation, but this struck me as the relevant parts) :
c:\users\aeon~1.wil\appdata\local\temp\xmlXPathInityhhfkk.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\aeon.williams\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
I downloaded the libxml2 wheel from here, and ran the ...cp27-none-win32.whl successfully. I tried to run python -m pip install lxml again after this, but still got the same error message.
I'm sure I'm struggling because of how little I understand Python modules and pip, but I'm not exactly sure what direction to go in now to try to get lxml working on my computer. If anyone has any suggestions, please let me know!

Error during boost and dlib installation for Python 3.6

I am struggling to install dlib for Python 3.6 on Windows 10. I've installed and built boost, added ...\boost_1_63_0 folder along with ...\boost_1_63_0\stage\lib folder to the PATH.
But I still have the following message
LINK : fatal error LNK1104: cannot open file 'python36.lib' [C:\Users\admin\dlib\tools\python\build\dlib_.vcxproj]
19 Warning(s)
1 Error(s)
Time Elapsed 00:05:03.17
error: cmake build failed!
when I try to type python setup.py install in command prompt.
Also, I have LINK : fatal error LNK1104: cannot open file 'libboost_python-vc140-mt-s-1_63.lib' message, when I try to install dlib through pip install dlib.
Please, help me! Otherwise, I'm feeling desperate right now after all those hours of searching for a valid solution.
After all those wasted hours of search, I have finally fixed this problem. So I will just leave the way that worked for me, so people who will face the same problem in future could find it.
The reason for such an error was that dlib's latest version doesn't support Python 3.6, which I have never noticed anywhere except this page.
The solution for problem was to install Python 3.5 and to add C:\..\Python35\libs, C:\..\Python35\include, C:\..\Python35, C:\..\Python35\Scripts paths to Windows system PATH.

Syntax error when trying to import Cntlr from arelle module

My goal is to use Arelle (open-source platform for XBRL community) to parse XBRL docs from the SEC.
I am following instructions found here.
I successfully git cloned Arelle's code into the Lib directory of Anaconda. However, when I try from arelle import Cntlr I get the following syntax error.
File "arelle\Cntlr.py", line 573
print(logEntry, file=file)
^
SyntaxError: invalid syntax
I am using Python 2.7.12. in Anaconda.
Any feedback is appreciated and I can provide further information upon request.
The instructions you found are rather old (from 2014), and appear to be outdated.
I was able to install the package with the following steps:
# This is needed because the 3to2 library can't be installed as an egg; if
# you don't install it with `pip` first the installation of Arelle will fail.
$ pip install 3to2
# Install Arelle directly from GitHub, this will take a while
$ pip install git+https://github.com/Arelle/Arelle
With 3to2 installed, the installation script setup.py proceeds to translate the Arelle sourcecode back to a Python 2 compatible form. Translation takes several minutes, be patient.

pip install returns code 1 error with saga_python. Any ideas?

I am trying to install saga-python (package for SAGA GIS) and cmd python keeps returning the same error: python setup.py egg_info failed with code 1 in C:\Users\MyUser\AppData\Local\Temp\pip-build-7uieglh9\saga-python. Any ideas why it occurs?
Also, tried a few tips from this question's answers:
Python pip install gives "Command "python setup.py egg_info" failed with error code 1" not working either.
Version is 3.5.2 and setuptools and ez_setup are allright.
Tried with easy_install as well. No results either, sais that the syntax is invalid.
Also tried with virtualenv and http://docs.python-guide.org/en/latest/dev/virtualenvs/. Error is caused by two different Python versions: 2.7 and 3.5.2. I cannot uninstall 2.7 (shell for some GIS software), but I need to make it work somehow.
This package only for python 2.X. See issue

python, pyenv and recompiling to handle a 64bit issue?

I have pyenv, and i want to use python 3.4.1 against apache.
To that end, I have installed mod_wsgi 4.2.7
In compiling mod_wsgi, I get the following error:
Object_NextNotImplemented' can not be used when making a shared object; recompile with -fPIC
/root/.pyenv/versions/3.4.1/lib/libpython3.4m.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [src/server/mod_wsgi.la] Error 1
According to this page the issue is something to do with a 64bit or a 32 bit or... I don't know.
Anyway, the solution is to re-compile python with some sort of flag.
How do i resolve this issue, bearing in mind that i am using pyenv?
This is not the solution, i still get the same error after having done this
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4 --enable-shared"
pyenv uninstall 3.4.1
pyenv install 3.4.1
so the first line - i didn't think would actually work, I don't know what it is doing. I guess it is just setting some magic system variable somewhere? Oh well, it is doing that.
I don't know what the unicode bit does - this was all suggested in this link here.
Becuase i am wanting to use python 3.4.1, and because it already exists, i then uninstall python 3.4.1
Then i reinstall python 3.4.1
If you wanted to do the same with python x.y.z, you would similarly have
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4 --enable-shared"
pyenv uninstall x.y.z
pyenv install x.y.z
If you had not installed x.y.z python earlier, um, then you wouldn't need to uninstall it.
This whole installation process takes... a while. I started writing this answer right after i kicked off the install command, and it only recently finished.
On finishing i get
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
Installed Python-3.4.1 to /root/.pyenv/versions/3.4.1
But i don't know if that is bad or good. The prompt itself doesn't seem to know either, what with all those question marks around.

Categories