Can't install pyethereum module - python

I'm new in Ethereum, so probably that's a silly question.
Now I'm trying to install serpent and pyethereum according to this tutorial. Everything works well, but when I'm launching Python's code:
import serpent
import pyethereum
There is an error: No module named pyethereum
How can I solve it?

The module's name is ethereum, not pyethereum. Using the following:
import serpent
import ethereum
should work just fine.

Follow the installation instructions from Pytherium's Readme, which read:
git clone https://github.com/ethereum/pyethereum/
cd pyethereum
python setup.py install
In the tutorial's instructions, develop branch is used, which seems to be failing according to the continuous integration badges.

Related

ImportError: cannot import name 'global_sdk_config' from 'aws_xray_sdk'

Through Tox i am trying to run a unit test in my local. The test seems to fail, giving me the following error:
from aws_xray_sdk import global_sdk_config
E ImportError: cannot import name 'global_sdk_config' from 'aws_xray_sdk'
Looking at the package installed in virtaul environment created by tox, i see the following files in aws_sray_sdk :
Upon closer insepection, i see when i had created virtual environment myself (without tox) and run pip install aws-xray-sdk, i also see sdk_config.py
and version.py in package aws_sdk_xray as shown below:
Can someone please help me with this.
In the screenshot you show us tox running a Python 3.7 environment, and in the following screenshots you show us the site-packages of Python 3.6.
These do not match.
You need to make sure you inspect the correct tox environment.

Importing module from Github to use in Python

I'm a beginner in Python and I have no experience with GitHub at all. I want to import the module semsimlib from the following URL: https://github.com/timvdc/semsimlib
I have looked on the internet for help on how to do this but most of it is very unclear and doesn't seem to work for me. Can anyone provide a detailed explanation on how to do this in a easy way?
It looks the repo does not provide appropriate scripts to simply install the package. There is no setup.py file and there is no distribution on pypi.
What you can do is go to site-packages folder inside your python installation or inside your virtual environment. Then run git clone https://github.com/timvdc/semsimlib. You should now be able to import semsimlib. Keep in mind that you will also have to install all the other dependencies your self one by one since there is also no requirements file.
You can also clone the repo into any folder on your computer and at the top of your script put:
import sys
sys.path.append("path/to/semsimlib/folder")
semsimlib will now be importable. However, I would try to get it to work with the first method.

Unable to import todoist.api

Trying to access the todoist api, and I copied some code from the api documentation. However, on my system I get an error stating:
Unable to import 'todoist.api'pylint(import-error).
I installed it with:
pip install todoist-python
as mentioned in the documentation
from todoist.api import TodoistAPI
I get my error on the very first line. How do I not get this?
You did everything right, so it's probably related to the way your installation is set.
Be sure you are using the same python you used to install the library. Check if the library is installed (pip list) and check if you're using the right Python when running the code. It's possible that the library was installed in one version and you're using the other.
I had the same problem, I solved it by following the GitHub instructions, but the name of the module to install using pip is todoist.

PyBuilder "ModuleNotFoundError: No module named" when running

I'm playing around with PyBuilder and I must be either missing something, or misunderstanding how PyBuilder works. In my test application, I'm importing the pdfrw library. I had installed it via pip and everything was working fine. However, I decided to try starting over in a new venv and not installing via pip first to see if PyBuilder pulled in the dependency. When I run pyb it runs fine, no errors, but when I try to run the code from the target directory it gives me an error of "ModuleNotFoundError: No module named pdfrw".
I'm used to using Maven and Gradle for Java development but this is my first foray into dependency management for Python. Can anyone let me know if I'm just misunderstanding what PyBuilder can do or if I'm just missing something in the configuration? Here's a copy of the simple build.py script that pyb is referencing:
from pybuilder.core import init, use_plugin
use_plugin("python.core")
use_plugin("python.install_dependencies")
default_task = "publish"
#init
def initialize(project):
project.depends_on('pdfrw')
Any help would be greatly appreciated.
Thanks,
Chris
Try to use
pyb install_dependencies
According to http://pybuilder.github.io/documentation/tutorial.html#WritingUnitTests

How to import modules from self created packages(wheel,eggs,tar.gz etc) local/or in artifactory in another python package?

How to import modules from self created packages(wheel,eggs,tar.gz etc) local/or in artifactory in another python package? (Possibly a code snippet would be helpful)
Requirement -
There is a developed Python Package abc.whl located on local intranet repository, and another file in second python project /xyz/def.py need to import a module from package abc.whl
I think first you have to install the wheel package.
pip install C:/some-dir/some-package.whl
If you need to import, you can just do
import some-package
So in your case
pip install abc.whl
import abc
Extract the .egg/.tar to *python_installation_path*\Lib\site-packages using 7-Zip

Categories

Resources