Sélectionner une page
Résoudre « OSError: libespeak.so.1: cannot open shared object file: No such file or directory »

Résoudre « OSError: libespeak.so.1: cannot open shared object file: No such file or directory »

Que faire quand on programme avec Pyttsx et qu’on a un problème avec libespeak.so?

En travaillant sur un petit projet qui me permettrait de faire parler mon Rasberry Pi 3, je me suis penché ce que me permettait de faire python en la matière.

C’est grâce à la bibliothèque Pyttsx, que vous pouvez faire parler votre petit ordinateur.

Alors voici le code source du petit programme en question (à exécuter avec Python2 et non Python3) que j’ai récupéré depuis le net et modifié :

import pyttsx
engine = pyttsx.init()
engine.setProperty(‘rate’, 70)

voices = engine.getProperty(‘voices’)
for voice in voices:
print (« Using voice: », repr(voice))
engine.setProperty(‘voice’, voice.id)
engine.say(« Hey! Do you want to make music with you phone ? »)
engine.say(« so download Shyne in your iphone at GoShyne.com »)
engine.runAndWait()

Quant je lançais le code avec Python3 rien ne fonctionnait, normal: pyttsx n’a pas été porté sur la version 3 de python.

Donc en lançant le script avec Python2, j’ai eu le message d’erreur suivant :

OSError: libespeak.so.1: cannot open shared object file: No such file or directory

Le problème n’était pas résolu même en installant pyttsx avec pip, c’est donc après quelques recherches que j’ai pu trouver la solution à mon problème.

Pour résoudre le problème de bibliothèque partagée quand on souhaite utiliser pyttsx il suffit d’exécuter la commande suivante :

sudo apt-get install espeak

Donc voilà le fin mot du problème, pour faire de la synthèse vocale avec Python, il faut pyttsx mais en plus il vous faudra installer Espeak sur votre système.

J’espère que ça vous aidera, n’hésitez pas à partager !

 

 

Résoudre « ImportError: No module named matplotlib.pyplot » (raspberry)

Résoudre « ImportError: No module named matplotlib.pyplot » (raspberry)

Dans le cadre de mon apprentissage de la programmation en Python et à l’occasion de l’acquisition d’un Raspberry 3 pour Noël (^_^), je me suis heurté à un soucis dès les premières minutes : impossible de charger une bibliothèque pourtant fraîchement installée :/

C’est à l’occasion de la découverte de mon tout nouveau Raspberry Pi 3 et des pages de ressources qui lui sont dédiées que je me suis retrouvé bloqué dès les premières minutes du tutoriel sur la programmation Python et la récupération via une API de données météorologiques.

En effet, pour suivre ce fameux cours intitulé « Graphing the weather » j’ai du installer deux bibliothèques Python non pré installées dans le pi, grâce à la commande suivante :

sudo apt-get install python3-matplotlib -y

sudo apt-get install python3-requests -y

Le hic c’est que j’ai eu un petit soucis avec matplotlib, Python m’indiquait systématiquement « ImportError: No module named matplotlib.pyplot« .

Après avoir passé plusieurs longues minutes à surfer sur le net, sans trouver de solution propre à mon cas de figure (je veux dire par là, ma configuration, je programme sur Raspberry Pi 3).Sur d’autres systèmes (mac par ex.) il fallait vérifier si la bibliothèque était installée au bon endroit (selon qu’on utilise Pthon 2 ou 3). Même « pip install » n’a pas fonctionné (problème de compilation de code, du coup j’ai regardé du côté des outils de compilation à installer ou mettre à jour… ça n’a pas résolu mon problème de matplotlib….). En regardant du côté du Shell Python j’ai voulu vérifier si malgré tout matplotlib était installé via la commande « help() » puis après avoir valider avec le paramètre « modules » : il était bien présent

Finalement j’ai pu finalement trouver la solution à ce problème de matplotlib. La méthode consiste à corriger un problème d’installation.

sudo apt-get install python-matplotlib

Et oui, après avoir installé matplotlib pour python 3, on l’installe à nouveau mais pour …. ben python tout court.

J’espère que ça vous aidera, n’hésitez pas à partager autour de vous!

Comment générer des liens de partage vers les réseaux sociaux ?

Comment générer des liens de partage vers les réseaux sociaux ?

Quand on souhaite mettre en place des boutons de partages en générale on se tourne vers des codes généré par les plateformes comme Facebook, Twitter ou Google+. Mais ils impliques souvent l’utilisation d’autres bouts de codes qui finissent par alourdir votre site.

Générer des liens sans utiliser les codes fournis par les différentes plateforme de réseaux sociaux est possible. Cela a plusieurs avantages, au hasard :

  • vous savez ce qu’il se passe
  • étant court le code est léger
  • vous ne faites pas appel à d’autres ressources qui pourraient ralentir le chargement de votre page.

Donc pour ce faire, nous partons du principe que vous avez déjà les boutons Twitter, Facebook etc et que vous souhaitez permettre le partage de votre page en cliquant sur ces fameux boutons.

Derrière chaque bouton, nous allons placer un lien qui ouvrira une nouvelle fenêtre qui permettra le partage.

Étape 1 : on définit la phrase de partage

par ex. « Créer votre propre musique en quelques secondes »

Étape 2 (non obligatoire) : on utilise des émojis

Ca peut etre intéressant d’insérer un emoji (attention à ne pas en abuser) pour faire ressortir votre message sur les flux de réseaux sociaux et attirer l’attention.

On se rend sur emojipedia.org et on chercher un jolie soleil (attention faites vos recherches en anglais) 🌞 (sun) et on rajoute des notes de musique 🎶

ça donne : « Créer votre propre musique sur votre iPhone en quelques secondes 🌞🎶 »

et on ajouter le lien vers votre page web et des hashtags, ce qui donne :

« Créer votre propre musique sur votre iPhone en quelques secondes 🌞🎶 http://goshyne.com #appli #music #iphone »

Étape 3 : on se rend sur un super site web dédié à la création de lien de partage

Son nom : ShareLinkGenerator

on récupère la phrase et on la colle dans les zone réservé à cet effet et relatif à chaque réseau social

Hyper simple !

A noter que ça fonctionne pour les réseaux sociaux suivants :

  • Facebook
  • Twitter
  • Google Plus
  • LinkedIn
  • Pinterest

Et la génération d’un lien « mailto » est également possible (avec remplissage automatique de l’objet et du corps évidemment) : seul bémol pour cette fonction, le destinataire du mail est défini à l’avance

Et voilà vous pouvez tester le résultat :

Partage Twitter  Partage Facebook
Si vous avez apprécié ce post, merci de le partager, ça pourrait aider d’autres personnes

Authentic life sources: podcasts, books, videos, articles

Authentic life sources: podcasts, books, videos, articles

To be authentic is, I guess, the best challenge in someone’s life. It’s not so easy to express yourself honestly. But it’s worth it, for you and for the world.

To do so, (in fact we can say when you are authentic you never do, you only be, and all the things you do is only a consequence of who you truly are), I have some great sources (Podcasts, blogs, books etc.)

I share with you some of them:

OutlierMagazine.co : It’s a great podcast about people (most of them are entrepreneurs) who decided to realize their dream, sometimes despite their fear, their doubts etc. They talk about their path, the choices they made, what they achieve professionally and personally. With each interview you have a takeaway. Even if you don’t like podcast, you can read the itws 😉

I recommend you the very inspiring interview of Ray Buttars: “Find permission to live

Because, if you want to be authentic, you cannot content yourself reading/listening to/watching mainstream media, trends and so on. You have to admit that your vision, like life itself, is constantly evolving, and your education and mainstream media cannot lead you to freedom. You must have other kind of information, this is why I personally recommend Collectiv Evolution, and the Mind Unleashed

I recommend CBS News Investigative Journalist Explains How Mainstream Media Brainwashes The Masses , 10 Movies That Could Change Your Understanding Of Life And Music is Medicine and More Effective Than Drugs at Managing Pain

Seth Godin sends you daily (very) short blog posts about personal thoughts and tips on life and work:

I recommend you his (for today) last post about empathy: http://sethgodin.typepad.com/seths_blog/2015/08/empathy.html
“… if you want to know why someone does what they do, start with what they know, what they believe and where they came from…”

Jiddu Krishnamurti, was …. well I don’t know how to qualify him (is it useful), I would say he is the most authentic person I know (ok I don’t know him personally and he past away).

Watch this video below (with french subtitles) and if you want to know more about him, a lot of books were publish based on his public talks.

I recommend you the book “Commentaries on Living
“Sorrow has to be understood and not ignored. To ignore it is to give continuity to suffering; to ignore it is to escape from suffering. To understand suffering needs an operational, experimental approach. To experiment is not to seek a definite result. If you seek a definite result, experiment is not possible. If you know what you want, the going after it is not experimentation. If you seek to get over suffering, which is to condemn it, then you do not understand its whole process; when you try to overcome suffering, your only concern is to avoid it. To understand suffering, there must be no positive action of the mind to justify or to overcome it: the mind must be entirely passive, silently watchful, so that it can follow without hesitation the unfolding of sorrow. Mind cannot follow the story of sorrow if it is tethered to any hope, conclusion or remembrance. To follow the swift movement of what is, the mind must be free; freedom is not to be had at the end, it must be there at the very beginning. « What is the meaning of all this sorrow?’’

Because to be able to understand this world and to take action you need a balance between the right information and silence, you need to meditate and there are a lot of ways to meditate : walk (just walk, without thinking, just observing what’s surrounding you), observe your thoughts or your breath, etc…

The key in meditation is observation. And you can say you don’t have time to meditate, but maybe you can consider meditation like an activity and you need to schedule in your todo list. That’s ok. But you can meditate everywhere, so personally, I meditate everyday when I lay down on my bed, and finally I fall asleep and that’s ok 🙂 Give it a try!

Of course, sometime I am too exhausted and I simply sleep and that’s fine, it’s not a competition and you don’t do it for anyone else but you. And remember, you need both, silence and information.

Too much information without practice is useless and it’ll increase thoughts in your brain and finally you won’t find balance and authenticity.

In the end of your life, when you’ll look back to see what happened, you’ll realize that the choices you made were the expression of who you were at this moment, and you won’t have regrets because you’ll understand that people (and you) do what they do along their understanding of the moment.

Understanding this fact, leads you to see life in a better way.

You’ll become wiser. You’ll be authentic. You’ll be your own master and your own student.

If you want to share some of your best sources you use in your journey, don’t be shy and share them in the comment section below!

Originally Posted on medium