SPSS Statistics 27 Cluster Slihouette throwing Python error - python

I am trying to use SPSS to do a cluster silhouette analysis like so:
STATS CLUS SIL CLUSTER=QCL_1 VARIABLES=V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18
V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 V32 V33 V34 V35 V36 V37 V38 V39 V40 V41 V42 V43
V44 V45 V46 V47 V48 V49 V50 V51 V52 V53 V54 V55 V56 V57 V58 V59 V60 V61 V62 V63 V64 V65 V66 V67 V68
V69 V70 V71 V72 V73 V74 V75 V76 V77 V78 V79 V80 V81 V82 V83 V84 V85 V86 V87 V88 V89 V90 V91 V92 V93
V94 V95 V96 V97 V98 V99 V100
NEXTBEST=nbc SILHOUETTE=sil DISSIMILARITY=EUCLID MINKOWSKIPOWER=2
/OPTIONS MISSING=IGNORE RENUMBERORDINAL=NO
/OUTPUT HISTOGRAM=YES ORIENTATION=HORIZONTAL THREEDBAR=YES THREEDCOUNTS=NO.
When I run this I get an error
'>' not supported between instances of 'float' and 'None Type'
Based on searchers I ran this is a Python error, but of course I can't fix Python errors in SPSS. Anyone know how deal with this?

Related

How would I get readeable text from webpage using selenium and python

I am using selenium to navigate a webpage - https://gmet.edupage.org/. I have gotten to the login page entered the login details and entered the page where I wanna read the text and print it into console. There isnt any text I dont want I just want to print out only and only the visible text not the code. Unfortunately there is a lot of text so manually setting each element and printing the text out would take ages. So is there an easy function or way to print out only the readeable text with selenium?
First find the body of the page and just print out the text within it using .text
txt = driver.find_element_by_class_name('browser_chrome')
print(txt.text)
Output:
Tieto stránky používajú súbory cookie na analýzu návštevnosti stránok. Informácie o používaní našich stránok sú na tento účel zdieľané so spoločnosťou Google.
Ok
PRIHLÁSENIE
GYMNÁZIUM, Metodova 2, Bratislava
Rozvrh
Známky
Písomky / DÚ
Objednávanie obedov
Menu
Aktuálne informácie
O škole
Školský rok
Informácie pre žiakov školy
Tlačivá na stiahnutie
Štúdium v zahraničí
Záujemcovia o štúdium
Projekt FinQ
Školská jedáleň
Školský psychológ
METODKA občianske združenie
Športový klub METODKA
Rada školy
Web Mail
Informácie pre verejnosť
Kontakty
Škola je zapojená
Škola získala certifikát
Naša škola získala v roku 2014 a v roku 2017 a 2020 opakovane obnovila francúzsky certifikát kvality LabelFrancEducation
VIAC »
Pondelok 12. 10. 2020
Počet návštev: 25872260
"Naše obedy"
VIAC »
Škola je zapojená
Škola je zapojená
FinQ – PROGRAM FINANČNÉHO VZDELÁVANIA A ROZVOJA FINANČNEJ KULTÚRY PRE ŠKOLY
VIAC »
Aktuálne informácie
Aktualizácia opatrení ku dňu 1.10.2020
Usmernenie MŠVVaŠ SR k postupu škôl a školských zariadení pri realizácií výchovno vzdelávacieho procesu počas mimoriadnej situácie v súvislosti s ochorením Covid-19
Nad rámec opatrení vyplývajúcich z manuálov opatrení pre školy a školské zariadenia sa bez ohľadu na farbu semaforu predmetnej školy neodporúča realizovať:
organizáciu škôl v prírode a lyžiarskych výcvikov, a to ani dennou formou
organizácia kultúrnych, umeleckých a tanečných aktivít mimo povinného výchovno-vzdelávacieho procesu
VIAC »
Ako postupovať v jednotlivých prípadoch v súvislosti s COVID-19?
Riaditeľka školy zverejňuje pre rodičov, žiakov a učiteľov prehľad ako postupovať v jednotlivých prípadoch pri ochorení COVID-19
Ako postupovať v jednotlivých prípadoch (podozrenie, resp. pozitivita)?
Vyhlásenie zákonného zástupcu o bezinfekčnosti
Vyhlásenie návštevníka školy po súhlase riaditeľky školy
Informácie pre rodičov a žiakov školy
Riaditeľka školy si Vám dovoľuje oznámiť, že aktuálna situácia na škole v súvislosti s pandémiou COVID- 19 je nezmenená od začiatku školského roka, t.j. škola je v zelenej fáze semaforu. Výsledky testovaných žiakov a učiteľov na COVID-19, ktorí nastúpili na začiatku školského roka do školy, boli všetky k dnešnému dňu, 18.9.2020, negatívne.
Podrobné informácie k jednotlivým fázam a im prislúchajúcim opatreniam sú uvedené v „Manuáli pre stredné školy k úprave organizácie a podmienok výchovy a vzdelávania v stredných školách pre školský rok 2020/2021“ zverejnenom na stránke MŠVVaŠ SR na tomto linku: https://www.minedu.sk/stredne-skoly-aktualizovane-1692020/, ďalej len „Manuál“. Podmienky výchovy a vzdelávania na našej škole sú vždy plne v súlade s uvedeným dokumentom, aj po jeho aktualizáciách.
VIAC »
Ukáž sa! Pomôž Eliške získať grant.
Podpor svojim hlasom Elišku Klepkovú zo Septimy A, ktorá je vynikajúca atlétka, výborná žiačka, držiteľka strieborného odznaku DofE.
Bližšie informácie o Eliške a spôsobe hlasovania nájdeš na stránke:
https://www.olympic.sk/ukazsa/eliska-klepkova.
Hlasovať môžeš každý deň do 27.9.2020.
Začiatok školského roka 2020/2021
Vyučovanie začína dňa 2.9.2020.
V tento deň majú žiaci vyučovanie od 8:00 hod. do 9:30 hod. (V tento deň sa obedy v školskej jedálni nevydávajú).
Vstup žiakov do školy je od 7:00 hod. do 8:00 hod. do budovy na Metodovej aj Jelačičovej z ulice aj z dvora, celkovo cez štyri vstupy. Prichádzať môžu priebežne. Pri každom vchode bude pedagogický dozor koordinovať vstup žiakov.
Odporúčame žiakom, aby sa nezdržiavali v priestoroch pred budovami školy a dodržiavali dvojmetrové rozostupy.
Z dôvodu dodržiavania protiepidemických opatrení a odporúčaní Ministerstva školstva, vedy, výskumu a športu SR zákonný zástupca:
VIAC »
OZNAM
Úradné hodiny počas prázdnin
v termíne od 13. 07. 2020 do 21. 08. 2020
sú každú stredu od 9.00 h do 12.00 h.
Ing. Zuzana Vaterková
riaditeľka školy
Informácia pre uchádzačov o štúdium na 8GYM
Všetkým uchádzačom o 8-ročné štúdium oznamujeme, že ku dňu 7.7.2020 sú všetky miesta na prijatie obsadené na 100%.
Ing. Zuzana Vaterková, riaditeľka školy
Kontakt
GYMNÁZIUM
Metodova 2
821 08 BRATISLAVA
+421 2 50 10 24 11
Fotogaléria

How to fix "Illegal instruction" when importing tensorflow

I'm having a problem each time importing tensor flow. Whenever I import it I get "Illegal instruction" Error and it exits my python console. All I found on the internet was a similar problem, but with (core dumped) explanation. Could someone explain what's wrong?
root#KALI:~# python3
Python 3.8.3rc1 (default, Apr 30 2020, 07:33:30)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Illegal instruction
root#KALI:~#
Python version:Python 3.8.3rc1
tensorflow version: 2.3.0
OS: kali-rolling
EDIT: My CPU info
cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 20
model : 2
model name : AMD E-450 APU with Radeon(tm) HD Graphics
stepping : 0
microcode : 0x5000119
cpu MHz : 855.090
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt hw_pstate vmmcall arat npt lbrv svm_lock nrip_save pausefilter
bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips : 3292.94
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
processor : 1
vendor_id : AuthenticAMD
cpu family : 20
model : 2
model name : AMD E-450 APU with Radeon(tm) HD Graphics
stepping : 0
microcode : 0x5000119
cpu MHz : 860.639
cache size : 512 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt hw_pstate vmmcall arat npt lbrv svm_lock nrip_save pausefilter
bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips : 3292.94
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

how to create groups from string? [duplicate]

This question already has answers here:
How do I split a list into equally-sized chunks?
(66 answers)
Closed 2 years ago.
I have string and I will do split for this string and then I will get 320 elements. I need to create 4 groups. Every group will be with 100 elements and the last group must be with 20 last elements. And the last step is that all groups must be string and not list. how can I do that?
I can do that if I know how many elements I have:
s_l = 'AA AAL AAOI ACLS ADT ADTX ADVM AEL AIG ALEC ALLY ALT AMCX ANGI APA APDN APLS APPS APRN AQUA ARMK ARNC ARVN ATNM ATOM ATRA ATSG AVCT AVT AX AXDX BCLI BE BEAM BJRI BKE BKU BLDR BLNK BMRA BOOT BXS BYD CAKE CALX CAPR CARG CARR CARV CATM CC CCL CELH CEQP CFG CHEF CHRS CIT CLDX CLR CLSK CNK CNST CODX COLB COOP CPE CRS CTVA CUK CVET CVI CVM CYTK DAL DBX DCP DDS DEI DISCA DISCK DK DNB DRNA DVAX DXC ECOM EIGR ELAN ELF ELY ENVA EQ EQT EXEL FE FHI FIXX FL FLWS FMCI FORM FOX FOXA FRTA FUN GBX GIII GM GNMK GOCO GPRE GRAF GRPN GRWG GTHX GWB HALO HCC HCSG HEAR HFC HGV HIBB HMSY HOG HOME HP HSC HTH HWC IMUX IMVT INO INOV INSG INSM INT IOVA IRDM ITCI JELD JWN KMT KODK KPTI KSS KTB KTOS KURA LAKE LB LCA LL LPI LPRO LSCC LYFT MAXR MBOT MCRB MCS MD MDP MGM MGNX MIC MLHR MOS MRSN MTOR MXL MYGN NCLH NCR NK NKTR NLS NMIH NOVA NTLA NTNX NUAN NVST NXTC ODP OFC OKE OMER OMF OMI ONEM OSPN OSUR OXY OZK PACW PD PDCE PDCO PEAK PGNY PLAY PLCE PLT PLUG PPBI PRPL PRTS PRVB PS PSNL PSTX PSXP PTGX PVAC RCUS REAL REZI RKT RMBL RPAY RRGB RRR RVLV RVP RXN SANM SAVE SBGI SC SCPL SEAS SEM SFIX SFM SGMS SGRY SHLL SHOO SHYF SIX SKX SLQT SMCI SNAP SNDX SNV SONO SPAQ SPCE SPR SPWH SPWR SRG SRNE SSNT SSSS STOR SUM SUN SUPN SVMK SWBI SYF SYRS TBIO TCDA TCF TCRR TDC TEX TFFP TGTX THC TMHC TRGP TRIP TSE TUP TVTY UBX UCBI UCTT UFS UNFI UONE UPWK URBN USFD VCRA VERI VIAC VIRT VIVO VREX VSLR VSTO VXRT WAFD WBS WFC WHD WIFI WKHS WORK WORX WRK WRTC WW WWW WYND XEC XENT XPER XRX YELP ZGNX ZUMZ ZYXI'
split_s_l = s_l.split(" ")
part_1 = ' '.join(split_s_l[:100])
part_2 = ' '.join(split_s_l[100:200])
part_3 = ' '.join(split_s_l[200:300])
part_4 = ' '.join(split_s_l[300:])
for part in (part_1, part_2, part_3, part_4):
print(part)
but I don't know how to do that If I have many elements in list.
For a variable number of items, you can loop using:
sep = ' '
num = 100
split_s_l = s_l.split(sep)
for i in range(0, len(split_s_l), num):
part = sep.join(split_s_l[i : i+num])
print(part)
Bear in mind that for the last slice in the example case ([300:400]) it does not matter that there are only 320 elements -- just the last 20 items will be included (no error).
Something like this?
def break_up(s, nwords, separator):
words = s.split()
return [separator.join(words[n:n+nwords]) for n in range(0, len(words), nwords)]
print(break_up('a b c d e f g h', 3, ' '))
Result:
['a b c', 'd e f', 'g h']
Of course, you might call as print(break_up(s_l, 100, ' '))
Below
s_l = 'AA AAL AAOI ACLS ADT ADTX ADVM AEL AIG ALEC ALLY ALT AMCX ANGI APA APDN APLS APPS APRN AQUA ARMK ARNC ARVN ATNM ATOM ATRA ATSG AVCT AVT AX AXDX BCLI BE BEAM BJRI BKE BKU BLDR BLNK BMRA BOOT BXS BYD CAKE CALX CAPR CARG CARR CARV CATM CC CCL CELH CEQP CFG CHEF CHRS CIT CLDX CLR CLSK CNK CNST CODX COLB COOP CPE CRS CTVA CUK CVET CVI CVM CYTK DAL DBX DCP DDS DEI DISCA DISCK DK DNB DRNA DVAX DXC ECOM EIGR ELAN ELF ELY ENVA EQ EQT EXEL FE FHI FIXX FL FLWS FMCI FORM FOX FOXA FRTA FUN GBX GIII GM GNMK GOCO GPRE GRAF GRPN GRWG GTHX GWB HALO HCC HCSG HEAR HFC HGV HIBB HMSY HOG HOME HP HSC HTH HWC IMUX IMVT INO INOV INSG INSM INT IOVA IRDM ITCI JELD JWN KMT KODK KPTI KSS KTB KTOS KURA LAKE LB LCA LL LPI LPRO LSCC LYFT MAXR MBOT MCRB MCS MD MDP MGM MGNX MIC MLHR MOS MRSN MTOR MXL MYGN NCLH NCR NK NKTR NLS NMIH NOVA NTLA NTNX NUAN NVST NXTC ODP OFC OKE OMER OMF OMI ONEM OSPN OSUR OXY OZK PACW PD PDCE PDCO PEAK PGNY PLAY PLCE PLT PLUG PPBI PRPL PRTS PRVB PS PSNL PSTX PSXP PTGX PVAC RCUS REAL REZI RKT RMBL RPAY RRGB RRR RVLV RVP RXN SANM SAVE SBGI SC SCPL SEAS SEM SFIX SFM SGMS SGRY SHLL SHOO SHYF SIX SKX SLQT SMCI SNAP SNDX SNV SONO SPAQ SPCE SPR SPWH SPWR SRG SRNE SSNT SSSS STOR SUM SUN SUPN SVMK SWBI SYF SYRS TBIO TCDA TCF TCRR TDC TEX TFFP TGTX THC TMHC TRGP TRIP TSE TUP TVTY UBX UCBI UCTT UFS UNFI UONE UPWK URBN USFD VCRA VERI VIAC VIRT VIVO VREX VSLR VSTO VXRT WAFD WBS WFC WHD WIFI WKHS WORK WORX WRK WRTC WW WWW WYND XEC XENT XPER XRX YELP ZGNX ZUMZ ZYXI'
words= s_l.split(" ")
num_of_100_groups = int(len(words) / 100)
groups = []
for i in range(0,num_of_100_groups):
groups.append(words[i * 100 : (i+1) * 100])
groups.append(words[num_of_100_groups * 100:])
for sub_group in groups:
print(' '.join(sub_group))

Controlling number of cores/threads in dask

I have a workstation with these specifications:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-1660 v4 # 3.20GHz
Stepping: 1
CPU MHz: 1200.049
CPU max MHz: 3800.0000
CPU min MHz: 1200.0000
BogoMIPS: 6400.08
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-15
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts flush_l1d
I have implemented dask to distribute some calculations and I am setting a Client() this way:
if __name__ == '__main__':
cluster = LocalCluster()
client = Client(cluster, asyncronous=True, n_workers=8,
threads_per_worker=2)
train()
It definitely seems that dask is using all resources when I call my delayed functions with dask.compute(*computations, scheduler='distributed'). The dashboard looks like:
Now, if I go ahead and change my Client() to:
if __name__ == '__main__':
cluster = LocalCluster()
client = Client(cluster, asyncronous=True, n_workers=4,
threads_per_worker=2)
train()
I would expect to be using the half of my resources, but as you can see on my dashboard that is not the case.
Why dask Client() is still using all resources? I would appreciate any input on this.
The Client class will make a cluster for you in the case that you haven't already specified one. Thos keywords only have an effect when not passing an existing cluster instance. You should instead put them into your call to LocalCluster:
cluster = LocalCluster(n_workers=4, threads_per_worker=2)
client = Client(cluster, asynchronous=True)
or you can simply skip making the cluster
client = Client(asynchronous=True, n_workers=4, threads_per_worker=2)

Homebrew + Python on mac os x 10.8: Fatal Python error: PyThreadState_Get: no current thread importing mapnik

I have 2 pythons on my mac (10.8.3): The default, and 2.7 version from homebrew.
So far, I could install modules and use them with my brew python. I installed mapnik with brew install mapnik (mapnik-2.1.0) and it compiled correctly. But, if I open python and enter import mapnik, the following error comes and python exits:
>>> import mapnik
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
Mac os x also shows an error window, with the following content:
Process: Python [60666]
Path: /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 2.7.3 (2.7.3)
Code Type: X86-64 (Native)
Parent Process: bash [60454]
User ID: 501
Date/Time: 2013-03-28 10:21:08.535 +0100
OS Version: Mac OS X 10.8.3 (12D78)
Report Version: 10
Interval Since Last Report: 128837 sec
Crashes Since Last Report: 5
Per-App Crashes Since Last Report: 4
Anonymous UUID: 567121E6-7BAC-335F-E3B0-DD24D1F9E6BA
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff94500d46 __kill + 10
1 libsystem_c.dylib 0x00007fff92afddf0 abort + 177
2 org.python.python 0x0000000105a77eaa Py_FatalError + 49
3 org.python.python 0x0000000105a76370 PyThreadState_Get + 28
4 org.python.python 0x0000000105a71f16 Py_InitModule4_64 + 58
5 libboost_python-mt.dylib 0x0000000104153288 boost::python::detail::init_module(char const*, void (*)()) + 40
6 org.python.python 0x00000001029fa716 _PyImport_LoadDynamicModule + 150
7 org.python.python 0x00000001029fa428 import_submodule + 296
8 org.python.python 0x00000001029f9ff1 load_next + 268
9 org.python.python 0x00000001029f80fb PyImport_ImportModuleLevel + 794
10 org.python.python 0x00000001029de9d3 builtin___import__ + 132
11 org.python.python 0x000000010296e335 PyObject_Call + 101
12 org.python.python 0x00000001029e8e10 PyEval_CallObjectWithKeywords + 93
13 org.python.python 0x00000001029e61b6 PyEval_EvalFrameEx + 11727
14 org.python.python 0x00000001029e32bd PyEval_EvalCodeEx + 1638
15 org.python.python 0x00000001029e2c51 PyEval_EvalCode + 54
16 org.python.python 0x00000001029f6e58 PyImport_ExecCodeModuleEx + 247
17 org.python.python 0x00000001029f99bf load_source_module + 1053
18 org.python.python 0x00000001029f9c7e load_package + 334
19 org.python.python 0x00000001029fa428 import_submodule + 296
20 org.python.python 0x00000001029f9ff1 load_next + 268
21 org.python.python 0x00000001029f80fb PyImport_ImportModuleLevel + 794
22 org.python.python 0x00000001029de9d3 builtin___import__ + 132
23 org.python.python 0x000000010296e335 PyObject_Call + 101
24 org.python.python 0x00000001029e8e10 PyEval_CallObjectWithKeywords + 93
25 org.python.python 0x00000001029e61b6 PyEval_EvalFrameEx + 11727
26 org.python.python 0x00000001029e32bd PyEval_EvalCodeEx + 1638
27 org.python.python 0x00000001029e2c51 PyEval_EvalCode + 54
28 org.python.python 0x0000000102a01a2b run_mod + 53
29 org.python.python 0x0000000102a0184d PyRun_InteractiveOneFlags + 365
30 org.python.python 0x0000000102a01367 PyRun_InteractiveLoopFlags + 188
31 org.python.python 0x0000000102a01218 PyRun_AnyFileExFlags + 60
32 org.python.python 0x0000000102a120b2 Py_Main + 3210
33 libdyld.dylib 0x00007fff966bf7e1 start + 1
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x00007fff5d29c2b0 rcx: 0x00007fff5d29c298 rdx: 0x0000000000000000
rdi: 0x000000000000ecfa rsi: 0x0000000000000006 rbp: 0x00007fff5d29c2c0 rsp: 0x00007fff5d29c298
r8: 0x00000000000003f5 r9: 0x00007fff5d29c270 r10: 0x00007fff94502342 r11: 0x0000000000000206
r12: 0x00007fff5d29cb00 r13: 0x0000000102e9b656 r14: 0x00000000000003f5 r15: 0x0000000000000000
rip: 0x00007fff94500d46 rfl: 0x0000000000000206 cr2: 0x00007fff7bff7ff0
Logical CPU: 0
Binary Images:
0x102961000 - 0x102961fff +org.python.python (2.7.3 - 2.7.3) <62DA7BCA-2A0C-3753-A043-7459827F56D1> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x102964000 - 0x102a6cfff +org.python.python (2.7.3, [c] 2004-2012 Python Software Foundation. - 2.7.3) <81E6FB4A-287C-37C3-A26D-D045B604933F> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Python
0x102c4c000 - 0x102c4efff +readline.so (0) <C4F1219C-CDFD-37D2-A762-22974D3F2918> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
0x102c54000 - 0x102c77fff +libreadline.6.2.dylib (6.2) <2131C2A4-E75D-3680-9C8D-E42D78A5E1B9> /usr/local/opt/readline/lib/libreadline.6.2.dylib
0x102cfc000 - 0x102d01fff +itertools.so (0) <F857A819-40A9-3F72-A0B1-3E97BA5F3DAA> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so
0x102d0a000 - 0x102f2cfff +_mapnik.so (0) <433DAD47-AB4D-37C5-A0EA-FE1134B63D3D> /usr/local/lib/python2.7/site-packages/mapnik/_mapnik.so
0x103603000 - 0x103978ff7 +libmapnik.dylib (0) <0E898678-9D86-35B4-A772-0248924F5BF3> /usr/local/Cellar/mapnik/2.1.0/lib/libmapnik.dylib
0x104138000 - 0x104170ff7 +libboost_python-mt.dylib (0) <9B5DD680-BEC9-3988-9F55-F59DA38CC175> /usr/local/lib/libboost_python-mt.dylib
0x1041b3000 - 0x1041c2ff7 +libboost_thread-mt.dylib (0) <24432300-9373-30B6-89F6-857CBEF9C105> /usr/local/lib/libboost_thread-mt.dylib
0x1041de000 - 0x10424dff7 +libfreetype.6.dylib (0) <490EDE42-5B78-34BA-85E7-D0547BE778E1> /usr/local/lib/libfreetype.6.dylib
0x104262000 - 0x104268fff +libltdl.7.dylib (0) <E437E59F-FC2E-3837-BDF8-301BEF13C7D6> /usr/local/lib/libltdl.7.dylib
0x10426c000 - 0x10428bff7 +libpng15.15.dylib (0) <52907DBF-A04C-325D-9E77-DF56A771026F> /usr/local/lib/libpng15.15.dylib
0x104293000 - 0x1042e6fff +libtiff.5.dylib (0) <AE85D7B1-F4E5-3B27-832D-5756EFCDE912> /usr/local/lib/libtiff.5.dylib
0x1042f2000 - 0x104326fff +libproj.0.dylib (0) <C799D9A7-0DDA-334D-9AEA-13A4AE7A67A2> /usr/local/lib/libproj.0.dylib
0x104333000 - 0x104441ff7 +libicuuc.50.1.dylib (0) <5FDBBF25-EEA6-3649-9ED6-B18CE89CE510> /usr/local/opt/icu4c/lib/libicuuc.50.1.dylib
0x1044a3000 - 0x1044b2fff +libboost_filesystem-mt.dylib (0) <B2C03485-5FA6-3744-BC99-DB4E87DA4D87> /usr/local/lib/libboost_filesystem-mt.dylib
0x1044c3000 - 0x1044c5ff7 +libboost_system-mt.dylib (0) <FE5E6E11-C7FB-3895-9976-526D22997EDC> /usr/local/lib/libboost_system-mt.dylib
0x1044ca000 - 0x104578fff +libboost_regex-mt.dylib (0) <BC1D7F46-F6AB-3964-B344-E692EFC5D3B7> /usr/local/lib/libboost_regex-mt.dylib
0x10461c000 - 0x10464bff7 +libjpeg.8.dylib (0) <9EC07360-CF18-3529-AE54-E60DBF1313DC> /usr/local/lib/libjpeg.8.dylib
0x104652000 - 0x105a24fff +libicudata.50.dylib (0) <B74D5789-7082-3084-9BF0-9A3AE6F2B046> /usr/local/opt/icu4c/lib/libicudata.50.dylib
0x105a26000 - 0x105b33fff org.python.python (2.7.2 - 2.7.2) <E7F3EED1-E55D-32AF-9649-77C814693F6A> /System/Library/Frameworks/Python.framework/Versions/2.7/Python
0x7fff62561000 - 0x7fff6259593f dyld (210.2.3) <36CAA36E-72BC-3E48-96D9-B96A2DF77730> /usr/lib/dyld
0x7fff8ae57000 - 0x7fff8ae7cff7 libc++abi.dylib (26) <D86169F3-9F31-377A-9AF3-DB17142052E4> /usr/lib/libc++abi.dylib
0x7fff8c50f000 - 0x7fff8c510ff7 libsystem_sandbox.dylib (220.2) <6838A6FD-8626-3356-BB4F-BB4787216207> /usr/lib/system/libsystem_sandbox.dylib
0x7fff8c511000 - 0x7fff8c523ff7 libz.1.dylib (43) <2A1551E8-A272-3DE5-B692-955974FE1416> /usr/lib/libz.1.dylib
0x7fff8d337000 - 0x7fff8d342fff libsystem_notify.dylib (98.5) <C49275CC-835A-3207-AFBA-8C01374927B6> /usr/lib/system/libsystem_notify.dylib
0x7fff8d9e6000 - 0x7fff8d9ebfff libcompiler_rt.dylib (30) <08F8731D-5961-39F1-AD00-4590321D24A9> /usr/lib/system/libcompiler_rt.dylib
0x7fff8dd72000 - 0x7fff8dd73fff libDiagnosticMessagesClient.dylib (8) <8548E0DC-0D2F-30B6-B045-FE8A038E76D8> /usr/lib/libDiagnosticMessagesClient.dylib
0x7fff902d7000 - 0x7fff90326ff7 libcorecrypto.dylib (106.2) <CE0C29A3-C420-339B-ADAA-52F4683233CC> /usr/lib/system/libcorecrypto.dylib
0x7fff9064f000 - 0x7fff90650fff libsystem_blocks.dylib (59) <D92DCBC3-541C-37BD-AADE-ACC75A0C59C8> /usr/lib/system/libsystem_blocks.dylib
0x7fff90a75000 - 0x7fff90a7dff7 libsystem_dnssd.dylib (379.37) <616FC901-151E-38BF-B2C4-24A351C5FAAD> /usr/lib/system/libsystem_dnssd.dylib
0x7fff914fd000 - 0x7fff9150afff libbz2.1.0.dylib (29) <CE9785E8-B535-3504-B392-82F0064D9AF2> /usr/lib/libbz2.1.0.dylib
0x7fff92899000 - 0x7fff928a7fff libcommonCrypto.dylib (60027) <BAAFE0C9-BB86-3CA7-88C0-E3CBA98DA06F> /usr/lib/system/libcommonCrypto.dylib
0x7fff92aa4000 - 0x7fff92b70ff7 libsystem_c.dylib (825.26) <4C9EB006-FE1F-3F8F-8074-DFD94CF2CE7B> /usr/lib/system/libsystem_c.dylib
0x7fff92bba000 - 0x7fff92bc0ff7 libunwind.dylib (35.1) <21703D36-2DAB-3D8B-8442-EAAB23C060D3> /usr/lib/system/libunwind.dylib
0x7fff92ed3000 - 0x7fff92f3cfff libstdc++.6.dylib (56) <EAA2B53E-EADE-39CF-A0EF-FB9D4940672A> /usr/lib/libstdc++.6.dylib
0x7fff93019000 - 0x7fff93065ff7 libauto.dylib (185.1) <73CDC482-16E3-3FC7-9BB4-FBA2DA44DBC2> /usr/lib/libauto.dylib
0x7fff930cf000 - 0x7fff930d5fff libmacho.dylib (829) <BF332AD9-E89F-387E-92A4-6E1AB74BD4D9> /usr/lib/system/libmacho.dylib
0x7fff93177000 - 0x7fff93199ff7 libxpc.dylib (140.42) <BBE558BD-5E55-35E4-89ED-1AA6B056D05A> /usr/lib/system/libxpc.dylib
0x7fff931f6000 - 0x7fff931f7ff7 libremovefile.dylib (23.2) <6763BC8E-18B8-3AD9-8FFA-B43713A7264F> /usr/lib/system/libremovefile.dylib
0x7fff931f8000 - 0x7fff93260ff7 libc++.1.dylib (65.1) <20E31B90-19B9-3C2A-A9EB-474E08F9FE05> /usr/lib/libc++.1.dylib
0x7fff9345d000 - 0x7fff9365dfff libicucore.A.dylib (491.11.2) <FD6282D8-DF3F-3842-8C2E-CF478D2B9669> /usr/lib/libicucore.A.dylib
0x7fff9365e000 - 0x7fff9365efff libkeymgr.dylib (25) <CC9E3394-BE16-397F-926B-E579B60EE429> /usr/lib/system/libkeymgr.dylib
0x7fff936d4000 - 0x7fff936dcfff liblaunch.dylib (442.26.2) <2F71CAF8-6524-329E-AC56-C506658B4C0C> /usr/lib/system/liblaunch.dylib
0x7fff9424d000 - 0x7fff9427bff7 libsystem_m.dylib (3022.6) <B434BE5C-25AB-3EBD-BAA7-5304B34E3441> /usr/lib/system/libsystem_m.dylib
0x7fff94284000 - 0x7fff94286fff libquarantine.dylib (52) <4BE2E642-A14F-340A-B482-5BD2AEFD9C24> /usr/lib/system/libquarantine.dylib
0x7fff94381000 - 0x7fff94382ff7 libdnsinfo.dylib (453.19) <14202FFB-C3CA-3FCC-94B0-14611BF8692D> /usr/lib/system/libdnsinfo.dylib
0x7fff944ef000 - 0x7fff9450aff7 libsystem_kernel.dylib (2050.22.13) <5A961E2A-CFB8-362B-BC43-122704AEB047> /usr/lib/system/libsystem_kernel.dylib
0x7fff94579000 - 0x7fff94587ff7 libsystem_network.dylib (77.10) <0D99F24E-56FE-380F-B81B-4A4C630EE587> /usr/lib/system/libsystem_network.dylib
0x7fff94821000 - 0x7fff9493992f libobjc.A.dylib (532.2) <90D31928-F48D-3E37-874F-220A51FD9E37> /usr/lib/libobjc.A.dylib
0x7fff9493a000 - 0x7fff9494fff7 libdispatch.dylib (228.23) <D26996BF-FC57-39EB-8829-F63585561E09> /usr/lib/system/libdispatch.dylib
0x7fff95c25000 - 0x7fff95d22ff7 libxml2.2.dylib (22.3) <47B09CB2-C636-3024-8B55-6040F7829B4C> /usr/lib/libxml2.2.dylib
0x7fff96350000 - 0x7fff96351ff7 libSystem.B.dylib (169.3) <9089D72D-E714-31E1-80C8-698A8E8B05AD> /usr/lib/libSystem.B.dylib
0x7fff96397000 - 0x7fff9639cfff libcache.dylib (57) <65187C6E-3FBF-3EB8-A1AA-389445E2984D> /usr/lib/system/libcache.dylib
0x7fff96646000 - 0x7fff9664dfff libcopyfile.dylib (89) <876573D0-E907-3566-A108-577EAD1B6182> /usr/lib/system/libcopyfile.dylib
0x7fff966bd000 - 0x7fff966c0ff7 libdyld.dylib (210.2.3) <F59367C9-C110-382B-A695-9035A6DD387E> /usr/lib/system/libdyld.dylib
0x7fff96961000 - 0x7fff96963ff7 libunc.dylib (25) <92805328-CD36-34FF-9436-571AB0485072> /usr/lib/system/libunc.dylib
0x7fff974ba000 - 0x7fff974f0fff libsystem_info.dylib (406.17) <4FFCA242-7F04-365F-87A6-D4EFB89503C1> /usr/lib/system/libsystem_info.dylib
0x7fff97850000 - 0x7fff97888fff libncurses.5.4.dylib (37.3) <68D5B5F5-8252-3F1E-AFF1-C6AFE145DBC1> /usr/lib/libncurses.5.4.dylib
0x7fff978d3000 - 0x7fff97abdff7 com.apple.CoreFoundation (6.8 - 744.18) <A60C3C9B-3764-3291-844C-C487ACF77C2C> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 18730
thread_create: 2
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=109.5M resident=53.3M(49%) swapped_out_or_unallocated=56.2M(51%)
Writable regions: Total=20.6M written=2644K(13%) resident=3256K(15%) swapped_out=0K(0%) unallocated=17.5M(85%)
REGION TYPE VIRTUAL
=========== =======
MALLOC 11.8M
MALLOC guard page 32K
STACK GUARD 56.0M
Stack 8192K
__DATA 2356K
__LINKEDIT 68.3M
__TEXT 41.2M
__UNICODE 544K
shared memory 12K
=========== =======
TOTAL 188.2M
Model: MacBookPro8,2, BootROM MBP81.0047.B27, 4 processors, Intel Core i7, 2 GHz, 8 GB, SMC 1.69f4
Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 512 MB
Graphics: AMD Radeon HD 6490M, AMD Radeon HD 6490M, PCIe, 256 MB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334348302D4348392020
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334348302D4348392020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 (5.106.98.100.16)
Bluetooth: Version 4.1.3f3 11349, 2 service, 11 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: ST9500420AS, 500.11 GB
Serial ATA Device: MATSHITADVD-R UJ-898
USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8509, 0xfa200000 / 3
USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfa100000 / 2
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0246, 0xfa120000 / 5
USB Device: BRCM2070 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0xfa110000 / 4
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x821a, 0xfa113000 / 8
USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd110000 / 3
Any problems with linking my pythons? how can I fix it? thanks!
It looks like you are running the homebrew python but either boost python or mapnik's python bindings ended up linking against the system python provided by apple. If a full clean and reinstall of boost and Mapnik does not fix this then I recommend stopping by #mapnik irc on freenode for help debugging. Generally to fix you need to call otool -L on boost_python.dylib and or on site_packages/mapnik/_mapnik.so to see which ended up with a linkage to the system python. Then you can fix by using install_name_tool.
I encountered the same problem between python27-apple and python27 (installed by Macport). I tried these steps, and it worked for me.
According to #Evert's comments of different libraries used by different python, I tried to revert the python27-apple to be "active".
sudo port select --list python
For my computer, it showed:
Available versions for python:
none
python25-apple
python26
python26-apple
python27 (active)
python27-apple
in which python27(by Macport) was currently active. Then,
sudo port select python python27-apple
to make python27-apple active as the default lib were called previously. To double check,
sudo port select --list python
It now showed:
Available versions for python:
none
python25-apple
python26
python26-apple
python27
python27-apple (active)
And the python crash had gone when I ran the scripts.
You can use the homebrew python like this:
/usr/bin/python2.7 yourscript.py
I face the similar problem in using androguard. Though it's not quite the same, it can be a reference. My crash also is Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6. Run otool -L <lib>, suggest the dylib link to the system python.
Try solution:
python-config --ldflags
Copy the output to corresponding MakeFile. For example change LDFLAGS += -lm -lbz2 -lz -llzma -lsnappy -lmuparser -lpython to LDFLAGS += -lm -lbz2 -lz -llzma -lsnappy -lmuparser -L/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -ldl -framework CoreFoundation.
make clean, then make again.
Now the dylib is OK, and no error anymore.
Alternatively ...
... when you use otool -L <lib> to find the wrongly linked python dylib you can use install_name_tool to change the symbol like:
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib <lib>

Categories