Instapy: cannot install regex

Created on 3 Dec 2018  ยท  8Comments  ยท  Source: timgrossmann/InstaPy

Traceback (most recent call last):
File "quickstart2.py", line 3, in
from instapy import InstaPy
File "/Users/ianbroudy/Desktop/iannew/instapy/__init__.py", line 3, in
from .instapy import InstaPy
File "/Users/ianbroudy/Desktop/iannew/instapy/instapy.py", line 25, in
from .comment_util import comment_image
File "/Users/ianbroudy/Desktop/iannew/instapy/comment_util.py", line 7, in
from .util import update_activity
File "/Users/ianbroudy/Desktop/iannew/instapy/util.py", line 7, in
import regex
ImportError: No module named regex
MacBook-Pro:iannew ianbroudy$ sudo pip install regex
Password:
The directory '/Users/ianbroudy/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/ianbroudy/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting regex
Downloading https://files.pythonhosted.org/packages/16/07/ee3e02770ed456a088b90da7c9b1e9aa227e3c956d37b845cef2aab93764/regex-2018.11.22.tar.gz (648kB)
100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 655kB 7.8MB/s
instagram-py 0.0.1 requires googleapis-common-protos>=1.5.5, which is not installed.
instagram-py 0.0.1 has requirement certifi>=2018.10.15, but you'll have certifi 2018.8.24 which is incompatible.
instagram-py 0.0.1 has requirement clarifai>=2.4.1, but you'll have clarifai 2.3.1 which is incompatible.
instagram-py 0.0.1 has requirement emoji>=0.5.1, but you'll have emoji 0.5.0 which is incompatible.
instagram-py 0.0.1 has requirement future>=0.17.1, but you'll have future 0.16.0 which is incompatible.
instagram-py 0.0.1 has requirement grpcio>=1.16.1, but you'll have grpcio 1.14.2 which is incompatible.
instagram-py 0.0.1 has requirement plyer>=1.3.1, but you'll have plyer 1.3.0 which is incompatible.
instagram-py 0.0.1 has requirement requests>=2.20.1, but you'll have requests 2.19.1 which is incompatible.
instagram-py 0.0.1 has requirement selenium>=3.141.0, but you'll have selenium 3.14.0 which is incompatible.
instagram-py 0.0.1 has requirement urllib3>=1.24.1, but you'll have urllib3 1.23 which is incompatible.
Installing collected packages: regex
Running setup.py install for regex ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-y8Vi6H/regex/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-WFwj_V/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-intel-2.7
copying regex_2/regex.py -> build/lib.macosx-10.14-intel-2.7
copying regex_2/_regex_core.py -> build/lib.macosx-10.14-intel-2.7
copying regex_2/test_regex.py -> build/lib.macosx-10.14-intel-2.7
running build_ext
building '_regex' extension
creating build/temp.macosx-10.14-intel-2.7
creating build/temp.macosx-10.14-intel-2.7/regex_2
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c regex_2/_regex.c -o build/temp.macosx-10.14-intel-2.7/regex_2/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-y8Vi6H/regex/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-WFwj_V/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-y8Vi6H/regex/
MacBook-Pro:iannew ianbroudy$

anyone having similar issues installing regex on mac? instapy hasnt been running for me since the unfollow_util fix

Most helpful comment

@ibroudy
1-) We need regex module for its super Unicode support used while deforming emojis in text and it is irreplaceable in that matter.

2-) Currently, that package is being used only by _Interact by Comments_ feature.

3-) regex does not consist of just python, it has a _C_ code, too, which will have to be installed once you initiate the pip install command..
_From your output_,

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c regex_2/_regex.c -o build/temp.macosx-10.14-intel-2.7/regex_2/_regex.o

cc command is trying to do that job for you

4-) But it fails cos you have Mac ๐Ÿ˜€

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1

It is possibly cos of you've not installed the appropriate version of the _Command Line Tools_ - XCode for your Mac OS [e.g. after upgrading it].
Install it running,

xcode-select --install

Also, you can run,

xcode-select -print-path

to see your active developer path.


@edwardium, do you also have a Mac?

Cheers ๐Ÿ˜

All 8 comments

hi i have same problem .
when i run Quickstart.py there is error : (( . ModuleNotFoundError: No module named 'regex' ))
and i try to install regex so i did : (( sudo pip install regex ))

but there is an error : >> . Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-qrPYjg/regex/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-lPhY06/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-qrPYjg/regex/

@ibroudy
1-) We need regex module for its super Unicode support used while deforming emojis in text and it is irreplaceable in that matter.

2-) Currently, that package is being used only by _Interact by Comments_ feature.

3-) regex does not consist of just python, it has a _C_ code, too, which will have to be installed once you initiate the pip install command..
_From your output_,

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c regex_2/_regex.c -o build/temp.macosx-10.14-intel-2.7/regex_2/_regex.o

cc command is trying to do that job for you

4-) But it fails cos you have Mac ๐Ÿ˜€

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1

It is possibly cos of you've not installed the appropriate version of the _Command Line Tools_ - XCode for your Mac OS [e.g. after upgrading it].
Install it running,

xcode-select --install

Also, you can run,

xcode-select -print-path

to see your active developer path.


@edwardium, do you also have a Mac?

Cheers ๐Ÿ˜

xcode-select --install

yes i have macbook

@uluQulu tnx for help now its work ๐Ÿ‘

@uluQulu thank you! i have installed regex, but this is the new error i am facing regarding the 'float'

Traceback (most recent call last):
File "/Users/ianbroudy/Desktop/broudy/instapy/instapy.py", line 375, in set_selenium_local_session
chrome_options=chrome_options)
File "/Users/ianbroudy/anaconda2/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
self.service.start()
File "/Users/ianbroudy/anaconda2/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Traceback (most recent call last):
File "quickstart2.py", line 16, in
headless_browser=False)
File "/Users/ianbroudy/Desktop/broudy/instapy/instapy.py", line 250, in __init__
self.set_selenium_local_session()
File "/Users/ianbroudy/Desktop/broudy/instapy/instapy.py", line 379, in set_selenium_local_session
Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at /Users/ianbroudy/Desktop/broudy/assets/chromedriver
MacBook-Pro:broudy ianbroudy$ python quickstart2.py
Traceback (most recent call last):
File "quickstart2.py", line 16, in
headless_browser=False)
File "/Users/ianbroudy/Desktop/broudy/instapy/instapy.py", line 250, in __init__
self.set_selenium_local_session()
File "/Users/ianbroudy/Desktop/broudy/instapy/instapy.py", line 391, in set_selenium_local_session
highlight_print(self.username, message, "initialization", "info", self.logger)
File "/Users/ianbroudy/Desktop/broudy/instapy/util.py", line 929, in highlight_print
print("\n{}".format(upper_char * ceil(output_len/len(upper_char))))
TypeError: can't multiply sequence by non-int of type 'float'
MacBook-Pro:broudy ianbroudy$

self.set_selenium_local_session()

File "/Users/ianbroudy/Desktop/insta/instapy/instapy.py", line 391, in set_selenium_local_session
highlight_print(self.username, message, "initialization", "info", self.logger)
File "/Users/ianbroudy/Desktop/insta/instapy/util.py", line 929, in highlight_print
print("\n{}".format(upper_char * ceil(output_len/len(upper_char))))
TypeError: can't multiply sequence by non-int of type 'float'

Welcome @edwardium @ibroudy

Good that, now, it works โ˜•


@ibroudy

TypeError: can't multiply sequence by non-int of type 'float'

See https://github.com/timgrossmann/InstaPy/issues/3490#issuecomment-443979528.


Cheers ๐Ÿ˜

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnvfitness picture johnvfitness  ยท  74Comments

HCWcoder picture HCWcoder  ยท  79Comments

jtrieuDev picture jtrieuDev  ยท  52Comments

EvraCloak picture EvraCloak  ยท  60Comments

CamiloB picture CamiloB  ยท  316Comments