Wagtailtrans 2.2 install fails - wagtail

I've read all the tutorials for setting up wagtailtrans 2.2.
I set the languages in my base.py according to the tutorials. I cannot install wagtailtrans. I get error output about Pillow.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/2f/rfv6v0056c58r9w83rzw30n00000gn/T/pip-install-yn4w0un0/pillow_5e7e668306de465dbfb8730b888585f9/setup.py", line 918, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
I tried to reinstall Pillow according to their docs and reinstall wagtailtrans but it doesn't work. The error doesn't mention anything about wagtailtrans but when I go to makemigrations I get the error ModuleNotFoundError: No module named 'wagtailtrans'
I haven't found anything online about this so any help would be most appreciated. Sorry if this is a N00b question

If you're on a Mac, install Xcode tools, amongst other useful libraries, it will also bring the missing zlib. To install Xcode tools, run the following command in a terminal:
xcode-select --install

Related

Why does apache cannot find libjsoncpp.so library?

While i'm trying to start apache2, error occures:
Syntax error on line 146 of /etc/apache2/apache2.conf:
Syntax error on line 1 of /etc/apache2/mods-enabled/server.load:
Cannot load /opt/dfplatform/bin/mod_server.so into server:
libjsoncpp.so.1: cannot open shared file: No such file or directory
So apache cannot see jsoncpp library, despite it stored in /usr/lib/x86_64-linux-gnu directory, along with other libraries, which apache perfectly finds. Both apache2 and library installed via apt install recently, so it must be fresh versions.
Why does apache don't want to see this specific library? Is it really something about versions and I must install older apache2/libjsoncpp?

create_task = asyncio.async: SyntaxError: invalid syntax

I'm creating a bot for Discord, and I just wrote this simple code:
import discord
TOKEN = "token"
client = discord.Client()
#client.event
async def on_ready():
print('Bot is ready.')
client.run(TOKEN)
and it produces the following error:
Traceback (most recent call last):
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/Main.py", line 1, in <module>
import discord
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/client.py", line 38, in <module>
from .state import ConnectionState
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/state.py", line 36, in <module>
from . import utils, compat
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/compat.py", line 32
create_task = asyncio.async
^
SyntaxError: invalid syntax
I searched and searched in the internet, and most of the people say to use Python 3.7, and that's what I've been using. Also, I've been using PyCharm as my IDE for Python.
Where does the error come from?
The version of discord.py you are using does not support Python 3.7 (in which async becomes a reserved keyword), as explained in this issue.
This version of discord.py, which is the default branch on the GitHub repo, is sadly the one installed by Pip.
How to fix it
You can either:
downgrade your version of Python to 3.6.
install another version of discord.py, based on the rewrite branch which is under active development, for example with the command : python3 -m pip install --user -U https://github.com/Rapptz/discord.py/archive/rewrite.zip
You can manually edit the file and change that line from create_task = asyncio.async to create_task = getattr(asyncio, 'async')
See more info here: https://github.com/Rapptz/discord.py/issues/1249
Do NOT add asyncio in your requirements, it's already in Python (since 3.5).
It is only relevant for Python 3.3, which does not include asyncio in its stdlib.
As a quick fix you can change asyncio.async to asyncio.ensure_future in the installed offending module and run it. Obviously the right thing to do is get the module updated, but when that's not possible the above will get it running again.
fix it with
pip install --upgrade aiohttp
pip install --upgrade websockets

MacPorts failed install port

I have trouble installing PHP, MySQL and Apache2 using MacPorts. Currently my OS is Mavericks and i'm downloading the official binary package for mavericks (also tried compile from source and running selfupdate) but I got this error message:
---> Building readline
Error: org.macports.build for port readline returned: command execution failed
Error: Failed to install readline
Please see the log file for port readline for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_readline/readline/main.log
Error: The following dependencies were not installed: apache2 apr-util mysql5 readline tcp_wrappers sqlite3 libedit pcre bzip2 autoconf213 gawk xz m4 gsed libtool libxml2 mhash pkgconfig
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port php5 failed
How can I solve this?
Thanks
Can you please check the error message block within the log file:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_readline/readline/main.log
Also make sure xcode command line tools are installed.
FYI: I faced similar error in Mavericks. My case was:
opt is a different partition which is mounted in /Volumes/opt
/opt is a symbolic link to /Volumes/opt.
It has been solved after editing /opt/local/etc/macports/macports.conf by replacing /opt with /Volumes/opt. Note sure this can help your case.

"_run_file" Error with pyramid buildout for Google App Engine in Ubuntu

I built a new project using buildout for Pyramid and GAE under Ubuntu 12.04 (using pyramid_appenegine pcreate template). I started a new VM to ensure no messing with distribute and setuptools in site-packages.
First of all, it results in that setuptools not found error, apparently solved with the patch provided by Tom Willis.
Then, buildout finishes building ok, but starting the develop site results in that error:
funky#funkydesktop:~/dev/gae1$ bin/devappserver parts/gae1
Traceback (most recent call last):
File "bin/devappserver", line 25, in <module>
sys.exit(dev_appserver._run_file('/home/funky/dev/gae1/parts/google_appengine/dev_appserver.py', locals()))
AttributeError: 'module' object has no attribute '_run_file'
Any hints to solve that one, or the whole process of building and starting the application?
I finally solved the problem by changing ae-sdk-version to 1.8.0.
Open buildout.cfg and change the line
ae-sdk-version=1.7.5
to:
ae-sdk-version=1.8.0
Or either you could see what happens with pyramid_appengine version (I got 0.8.1 instead of 0.8.2-a2 which is the current one in pypi.python.org). This is the package that holds the template.

Pyramid on Google’s App Engine using buildout resulting in setuptools not found error

I am trying to run pyramid application on google's app engine using buildout. I followed this link gae_buildout and got struck while running the buildout. Its shows "setuptools not found error" despite of seetuptools being installed in the virtual environment. I tried few work arounds and nothing turned fruitful, any thoughts on this ?
Find the error trace below. I am using pyramid 1.4 version.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "c:\myenv\newproject\eggs\zc.buildout-2.2.1-py2.7.egg\zc\buildout\buildou
t.py", line 1942, in main
getattr(buildout, command)(args)
File "c:\myenv\newproject\eggs\zc.buildout-2.2.1-py2.7.egg\zc\buildout\buildou
t.py", line 622, in install
installed_files = self[part]._call(recipe.install)
File "c:\myenv\newproject\eggs\zc.buildout-2.2.1-py2.7.egg\zc\buildout\buildou
t.py", line 1366, in _call
return f()
File "c:\myenv\newproject\eggs\rod.recipe.appengine-2.0.2-py2.7.egg\rod\recipe
\appengine\__init__.py", line 377, in install
self.copy_packages(ws, temp_dir)
File "c:\myenv\newproject\eggs\rod.recipe.appengine-2.0.2-py2.7.egg\rod\recipe
\appengine\__init__.py", line 284, in copy_packages
self.write_pkg_resources(ws, lib)
File "c:\myenv\newproject\eggs\rod.recipe.appengine-2.0.2-py2.7.egg\rod\recipe
\appengine\__init__.py", line 267, in write_pkg_resources
assert len(setuptools_eggs) == 1, "setuptools not found"
AssertionError: setuptools not found
Got the same (Ubuntu 12.04) and finally solved the problem by changing ae-sdk-version to 1.8.0 from buildout.cfg
Open buildout.cfg and change the line:
ae-sdk-version=1.7.5
to:
ae-sdk-version=1.8.0
...or the latest one from here. Now seems to be 1.8.5, but 1.8.0 worked for me.
The problem in fact comes because PyPI is not serving last version of pyramid_appengine. It's serving 0.8.1 and should be (latest) 0.8.2-a2. You can download and install in your virtualenv the latest version in a tarball from here: https://pypi.python.org/pypi/pyramid_appengine/
So here's another solution.
It seems that rod.recipe.appengine doesn't work with the setuptools versions of the system, and it doesn't download the last version in that buildout. So the solution is to force to download a newer version of setuptools that rod.recipe.appengine likes.
Edit the versions.cfg file (should appear just the [versions] tag) and add the following line:
[versions]
setuptools = 1.1.7
(other older versions work as well, I tested successfully with 0.9.8)
And now seems to work easier without needing the mentioned patches (thanks Tom) that are harder to update.
This happened to me as well.
I started looking at the code and noticed it was explicitly looking for an egg install of setuptools, and none of the places I had installations of it were eggs for some reason.
I decided I'd go delete them from my site-packages and re-run the tools to download them, and after only killing the copy in my virtual env, and re-running the bootstrap and buildout, it got the egg and everything started working fine.

Resources